2016-07-09 15 views
1

最近、beanstalkに新しいnode.jsアプリケーションをデプロイし、次のエラーが発生しましたか?Amazon Elastic Beanstalkにnode.jsアプリケーションをデプロイする際のエラー

[インスタンス:i-cce89e4a]インスタンスでコマンドが失敗しました。 npm_install raise e subprocess.CalledProcessError:コマンド '['/opt/elasticbeanstalk/node-install/node-v4]コマンドラインで、次のコマンドを実行します。 .4.6-linux-x64/bin/npm '、' --production '、' rebuild ']'は0以外の終了ステータスを返しました254.フック/opt/elasticbeanstalk/hooks/configdeploy/pre/50npm.shが失敗しました。詳細は、コンソールまたはEB CLIを使用して/var/log/eb-activity.logチェック

ノードの私のバージョンは次のとおりです。4.4.7

展開は以下の最後の行で失敗しているように見える。

except Exception, e: 
      npm_debug_log = '/var/log/nodejs/npm-debug.log' 
      app_npm_debug_log = os.path.join(app_path, "npm-debug.log") 
      write_event('Failed to run npm install. Snapshot logs for more details.', 'ERROR') 
      if not os.path.exists(app_npm_debug_log): 
       utc_time_str = datetime.datetime.utcnow().strftime("UTC %Y/%m/%d %H:%M:%S") 
       err_msg = str.format("{0} cannot find application npm debug log at {1} \n", utc_time_str, app_npm_debug_log) 
       print(err_msg) 
       with open(npm_debug_log, 'a') as f: 
        f.write(err_msg) 
      else: 
       shutil.copyfile(app_npm_debug_log, npm_debug_log) 
      raise e 

そこに固溶?

手動でファイルを圧縮してファイルを作成しました。

アプリは完全にローカルで動作します。

誰でも手助けできますか?

私が答えるのに十分な情報を持っていない
Application deployment failed at 2016-07-09T18:47:38Z with exit status 1 and error: Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh failed. 

+ /opt/elasticbeanstalk/containerfiles/ebnode.py --action npm-install 
npm WARN package.json [email protected] No repository field. 

> [email protected] postinstall /tmp/deployment/application/node_modules/history 
> node ./npm-scripts/postinstall.js 

npm ERR! Linux 4.4.14-24.50.amzn1.x86_64 
npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v4.4.6-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v4.4.6-linux-x64/bin/npm" "--production" "rebuild" 
npm ERR! node v4.4.6 
npm ERR! npm v2.15.5 
npm ERR! path /tmp/deployment/application/node_modules/gulp-main-bower-files/node_modules/main-bower-files/node_modules/vinyl-fs/node_modules/duplexify/node_modules/readable-stream/node_modules/unreachable-branch-transform/node_modules/recast/node_modules/esprima/bin/esvalidate.js 
npm ERR! code ENOENT 
npm ERR! errno -2 
npm ERR! syscall chmod 

npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/deployment/application/node_modules/gulp-main-bower-files/node_modules/main-bower-files/node_modules/vinyl-fs/node_modules/duplexify/node_modules/readable-stream/node_modules/unreachable-branch-transform/node_modules/recast/node_modules/esprima/bin/esvalidate.js' 
npm ERR! enoent This is most likely not a problem with npm itself 
npm ERR! enoent and is related to npm not being able to find a file. 
npm ERR! enoent 

npm ERR! Please include the following file with any support request: 
npm ERR! /tmp/deployment/application/npm-debug.log 
Running npm install: /opt/elasticbeanstalk/node-install/node-v4.4.6-linux-x64/bin/npm 
Setting npm config jobs to 1 
npm config jobs set to 1 
Running npm with --production flag 
Failed to run npm install. Snapshot logs for more details. 
Traceback (most recent call last): 
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 695, in 
main() 
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 677, in main 
node_version_manager.run_npm_install(options.app_path) 
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 136, in run_npm_install 
self.npm_install(bin_path, self.config_manager.get_container_config('app_staging_dir')) 
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install 
raise e 
subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v4.4.6-linux-x64/bin/npm', '--production', 'rebuild']' returned non-zero exit status 254. 

答えて

2

... /var/log/eb-activity.logは何と言っていますか?

...しかし t2.smallを使用してbeanstalkにnpmをインストールすると、同様のエラーが発生します。十分なRAMがなく、npmが失敗しました。より大きなインスタンスにアップグレードすることで、問題を解決できます。 (コミットするnode_moduleもこの問題を解決することができましたが、私はしたくありませんでした)。

あなたはすべきことは、インスタンスにSSHで接続し、展開時に起こっていることをtop/htopで監視することです。

+1

メディアインスタンスにアップグレードしました。 – user1526912

+0

実際に私はまもなく話をしました。同じエラーが発生しました。 – user1526912

+0

同じ問題があって、より高いメモリインスタンスにアップグレードしていました。 – aravindaM

3

私は以前に自分のzipファイルにnode_modulesフォルダを含めていました。このフォルダを除外すると問題が解決しました

関連する問題