特定于AWS Elastic Beanstalk的{Socket.io NPM安装错误

时间:2018-01-19 20:39:23

标签: npm socket.io elastic-beanstalk amazon-elastic-beanstalk

似乎socket.io导致我在AWS Elastic Beanstalk上出现NPM安装错误。

我部署到EB没问题。我将socket.io添加到我的package.json并部署到EB我得到一个错误。我将其删除然后再次通过。

我通过npm i socket.io --save添加socket.io,添加到package.json的行是"socket.io": "^2.0.4"

我能够可靠地导致此失败或修复问题,只需从package.json中删除上述行或将其重新添加。有关罪魁祸首的任何想法?

我在本地和aws上使用相同的节点版本

很难找到错误的细节,但这里是eb-activity.log的输出

  

运行npm install:   /opt/elasticbeanstalk/node-install/node-v6.11.5-linux-x64/bin/npm
  将npm配置作业设置为1 npm配置作业设置为1运行npm   with --production flag无法运行npm install。快照日志   更多细节。 Traceback(最近一次调用最后一次):       文件“/opt/elasticbeanstalk/containerfiles/ebnode.py”,第695行,in         主要()       文件“/opt/elasticbeanstalk/containerfiles/ebnode.py”,第677行,主要         node_version_manager.run_npm_install(options.app_path)       在run_npm_install中的文件“/opt/elasticbeanstalk/containerfiles/ebnode.py”,第136行         self.npm_install(bin_path,self.config_manager.get_container_config('app_staging_dir'))       在npm_install中的文件“/opt/elasticbeanstalk/containerfiles/ebnode.py”,第180行         提升e subprocess.CalledProcessError:命令'['/opt/elasticbeanstalk/node-install/node-v6.11.5-linux-x64/bin/npm',   '--production','install']'返回非零退出状态1   (执行人:: NonZeroExitStatus)

     

[2018-01-19T20:30:59.814Z] INFO [3067] - [应用程序更新   shippable.lowy-api-dev.develop.111@42/AppDeployStage0/AppDeployPreHook/50npm.sh]   :活动失败。 [2018-01-19T20:30:59.814Z] INFO [3067] -   [应用程序更新   shippable.lowy-api-dev.develop.111@42/AppDeployStage0/AppDeployPreHook]   :活动失败。 [2018-01-19T20:30:59.814Z] INFO [3067] -   [应用程序更新   shippable.lowy-api-dev.develop.111@42/AppDeployStage0]:活动   失败。

我在Elastic Beanstalk和socket.io 2.0.4上使用节点v 6.11.5

更新;按照https://gist.github.com/jmar777/9281403的说明,我将SSH连接到我的Elastic Beanstalk实例并手动运行npm install。一切正常,没有错误!预安装输出与上述错误日志相同,但运行正常。

为什么在Elastic Beanstalk运行安装但不是手动运行时会出现错误?

0 个答案:

没有答案
相关问题