3

ローカルで正常に動作している nodejs アプリを heroku にプッシュしようとすると、ターミナルに次のように表示されます。

dcaclab@ubuntu:~/RubymineProjects/nodejs_consumer$ git push heroku master
Counting objects: 1417, done.
Compressing objects: 100% (1195/1195), done.
Writing objects: 100% (1417/1417), 2.02 MiB | 22 KiB/s, done.
Total 1417 (delta 247), reused 0 (delta 0)

-----> Node.js app detected
-----> Resolving engine versions
       Using Node.js version: 0.10.6
       Using npm version: 1.2.21
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
       npm WARN package.json node-example@0.0.1 No repository field.
       npm WARN package.json node-example@0.0.1 No readme data.
       npm WARN package.json node@0.0.0 No repository field.
       npm WARN package.json faye-websocket@0.4.0 No repository field.
       npm WARN package.json faye-websocket@0.4.0 'repositories' (plural) Not supported.
       npm WARN package.json Please pick one as the 'repository' field
       npm WARN package.json rbytes@0.0.2 No repository field.
       npm WARN package.json node-example@0.0.1 No repository field.
       npm WARN package.json node-example@0.0.1 No readme data.
       npm WARN package.json node@0.0.0 No repository field.
       npm WARN package.json faye-websocket@0.4.0 No repository field.
       npm WARN package.json faye-websocket@0.4.0 'repositories' (plural) Not supported.
       npm WARN package.json Please pick one as the 'repository' field
       npm WARN package.json rbytes@0.0.2 No repository field.

       > weak@0.2.2 install /tmp/build_f86ikz343m5u/node_modules/dnode/node_modules/weak
       > node-gyp rebuild

       gyp http GET http://nodejs.org/dist/v0.10.6/node-v0.10.6.tar.gz
       gyp http 200 http://nodejs.org/dist/v0.10.6/node-v0.10.6.tar.gz
       make: Entering directory `/tmp/build_f86ikz343m5u/node_modules/dnode/node_modules/weak/build'
         CXX(target) Release/obj.target/weakref/src/weakref.o
         SOLINK_MODULE(target) Release/obj.target/weakref.node
         SOLINK_MODULE(target) Release/obj.target/weakref.node: Finished
         COPY Release/weakref.node
       make: Leaving directory `/tmp/build_f86ikz343m5u/node_modules/dnode/node_modules/weak/build'

       > rbytes@0.0.2 install /tmp/build_f86ikz343m5u/node_modules/shoe/node_modules/sockjs/node_modules/rbytes
       > node-waf configure build

       sh: node-waf: not found
       npm ERR! weird error 127
       npm ERR! not ok code 0
 !     Failed to rebuild dependencies with npm
 !     Heroku push rejected, failed to compile Node.js app

To git@heroku.com:dcaclab-simulator.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:dcaclab-simulator.git'

ここに私のpackage.jsonファイルがあります:

{
  "name": "node-example",
  "version": "0.0.1",
  "dependencies": {
    "dnode": "1.0.5",
    "shoe": "0.0.10"
  },
  "engines": {
    "node": "0.10.x",
    "npm": "1.2.x"
  }
}

何かアイデアはありますか?

編集

ノード0.8を使用しようとしましたが、これが得られたものです:

dcaclab@ubuntu:~/RubymineProjects/nodejs_consumer$ git push heroku master
Counting objects: 1420, done.
Compressing objects: 100% (1198/1198), done.
Writing objects: 100% (1420/1420), 2.02 MiB | 24 KiB/s, done.
Total 1420 (delta 249), reused 0 (delta 0)

-----> Node.js app detected
-----> Resolving engine versions
       Using Node.js version: 0.8.23
       Using npm version: 1.2.21
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
       npm WARN package.json node-example@0.0.1 No repository field.
       npm WARN package.json node-example@0.0.1 No readme data.
       npm WARN package.json node@0.0.0 No repository field.
       npm WARN package.json rbytes@0.0.2 No repository field.
       npm WARN package.json faye-websocket@0.4.0 No repository field.
       npm WARN package.json faye-websocket@0.4.0 'repositories' (plural) Not supported.
       npm WARN package.json Please pick one as the 'repository' field
       npm WARN package.json node-example@0.0.1 No repository field.
       npm WARN package.json node-example@0.0.1 No readme data.
       npm WARN package.json node@0.0.0 No repository field.
       npm WARN package.json rbytes@0.0.2 No repository field.
       npm WARN package.json faye-websocket@0.4.0 No repository field.
       npm WARN package.json faye-websocket@0.4.0 'repositories' (plural) Not supported.
       npm WARN package.json Please pick one as the 'repository' field

       > weak@0.2.2 install /tmp/build_1uw8vrtz5u7yu/node_modules/dnode/node_modules/weak
       > node-gyp rebuild

       gyp http GET http://nodejs.org/dist/v0.8.23/node-v0.8.23.tar.gz
       gyp http 200 http://nodejs.org/dist/v0.8.23/node-v0.8.23.tar.gz
       make: Entering directory `/tmp/build_1uw8vrtz5u7yu/node_modules/dnode/node_modules/weak/build'
         CXX(target) Release/obj.target/weakref/src/weakref.o
         SOLINK_MODULE(target) Release/obj.target/weakref.node
         SOLINK_MODULE(target) Release/obj.target/weakref.node: Finished
         COPY Release/weakref.node
       make: Leaving directory `/tmp/build_1uw8vrtz5u7yu/node_modules/dnode/node_modules/weak/build'

       > rbytes@0.0.2 install /tmp/build_1uw8vrtz5u7yu/node_modules/shoe/node_modules/sockjs/node_modules/rbytes
       > node-waf configure build

       Checking for program g++ or c++          : /usr/bin/g++ 
       Checking for program cpp                 : /usr/bin/cpp 
       Checking for program ar                  : /usr/bin/ar 
       Checking for program ranlib              : /usr/bin/ranlib 
       Checking for g++                         : ok  
       Checking for node path                   : not found 
       Checking for node prefix                 : ok /tmp/node-node-Rkll 
       'configure' finished successfully (0.027s)
       Waf: Entering directory `/home/dcaclab/RubymineProjects/nodejs_consumer/node_modules/shoe/node_modules/sockjs/node_modules/rbytes/build'
       Waf: Leaving directory `/home/dcaclab/RubymineProjects/nodejs_consumer/node_modules/shoe/node_modules/sockjs/node_modules/rbytes/build'
       Traceback (most recent call last):
         File "/tmp/node-node-Rkll/bin/node-waf", line 16, in <module>
           Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
         File "/tmp/node-node-Rkll/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare
           prepare_impl(t, cwd, ver, wafdir)
         File "/tmp/node-node-Rkll/bin/../lib/node/wafadmin/Scripting.py", line 135, in prepare_impl
           main()
         File "/tmp/node-node-Rkll/bin/../lib/node/wafadmin/Scripting.py", line 188, in main
           fun(ctx)
         File "/tmp/node-node-Rkll/bin/../lib/node/wafadmin/Scripting.py", line 386, in build
           return build_impl(bld)
         File "/tmp/node-node-Rkll/bin/../lib/node/wafadmin/Scripting.py", line 405, in build_impl
           bld.compile()
         File "/tmp/node-node-Rkll/bin/../lib/node/wafadmin/Build.py", line 268, in compile
           os.chdir(self.bldnode.abspath())
       OSError: [Errno 2] No such file or directory: '/home/dcaclab/RubymineProjects/nodejs_consumer/node_modules/shoe/node_modules/sockjs/node_modules/rbytes/build'
       npm ERR! weird error 1
       npm ERR! not ok code 0
 !     Failed to rebuild dependencies with npm
 !     Heroku push rejected, failed to compile Node.js app

To git@heroku.com:dcaclab-simulator.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:dcaclab-simulator.git'
4

4 に答える 4

3

したがって、rbytesパッケージは2年間変更されておらず、その間にノードはnode-wafビルドシステムからnode-gyp. node の時点でv0.10.0node-wafは含まれなくなったため、sh: node-waf: not foundエラー メッセージが表示されます。いくつかのオプションがあると思います(優先順):

  1. rbytes の代わりに最新のモジュールを使用する
  2. rbytes の作成者に、最近のノードをサポートするように更新して新しいバージョンをリリースするよう説得する
  3. rbytes をフォークして自分で修正する
  4. package.json エンジンをノード 0.8 に設定して、もう一度お試しください

編集

エラー メッセージ #2​​ は、まだ rbytes が適切にビルドされていないように見えます。特にエラーを理解するには、そのパッケージを掘り下げる必要があります。ローカルでどのように/なぜ機能するのかわかりませんが、heroku で問題が発生していますが、rbytes メンテナーがメンテナンスを行う時が来たと思います。

于 2013-05-22T13:15:19.917 に答える
1

同じ問題に直面しました。既存の node_module ディレクトリを削除するだけです。そして npm install を実行します。それでおしまい

于 2014-05-21T11:09:44.083 に答える