【问题标题】:Trouble deploying KeystoneJS on Elastic Beanstalk在 Elastic Beanstalk 上部署 KeystoneJS 时遇到问题
【发布时间】:2016-09-16 13:37:21
【问题描述】:

我有一个 KeystoneJS 应用程序,我正试图在 t2.micro 实例上的 Elastic Beanstalk 上部署。在部署过程中,部署出错并在 eb-activity.log 中显示以下输出:

> kerberos@0.0.11 install /tmp/deployment/application/node_modules/keystone/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)


Running npm install: /opt/elasticbeanstalk/node-install/node-v4.4.3-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 681, in 
main()
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 663, in main
node_version_manager.run_npm_install(options.app_path)
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 131, 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 166, in npm_install
raise e
subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v4.4.3-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status -9.

我还检查了 npm-debug.log 并看到以下内容:

127706 info install kerberos@0.0.11
127707 silly gunzTarPerm extractEntry _baseAssign.js
127708 silly gunzTarPerm extractEntry _assignInDefaults.js
127709 silly gunzTarPerm extractEntry unzip.js
127710 silly gunzTarPerm extractEntry uniq.js
127711 silly gunzTarPerm extractEntry _baseGt.js
127712 silly gunzTarPerm extractEntry tap.js
127713 silly gunzTarPerm extractEntry _baseFor.js
127714 silly gunzTarPerm extractEntry toFinite.js
127715 silly gunzTarPerm extractEntry _baseFor.js
127716 silly gunzTarPerm extractEntry toFinite.js
127717 silly gunzTarPerm extractEntry es6/weak-map.js
127718 silly gunzTarPerm modified mode [ 'es6/weak-map.js', 438, 420 ]
127719 verbose unsafe-perm in lifecycle false
127720 verbose stack Error: spawn ENOMEM
127720 verbose stack     at exports._errnoException (util.js:870:11)
127720 verbose stack     at ChildProcess.spawn (internal/child_process.js:298:11)
127720 verbose stack     at exports.spawn (child_process.js:362:9)
127720 verbose stack     at spawn (/opt/elasticbeanstalk/node-install/node-v4.4.3-linux-x64/lib/node_modules/npm/lib/utils/spawn.js:7:13)
127720 verbose stack     at runCmd_ (/opt/elasticbeanstalk/node-install/node-v4.4.3-linux-x64/lib/node_modules/npm/lib/utils/lifecycle.js:211:14)
127720 verbose stack     at /opt/elasticbeanstalk/node-install/node-v4.4.3-linux-x64/lib/node_modules/npm/lib/utils/lifecycle.js:179:7
127720 verbose stack     at nextTickCallbackWith0Args (node.js:420:9)
127720 verbose stack     at process._tickCallback (node.js:349:13)
127721 verbose cwd /tmp/deployment/application
127722 error Linux 4.4.8-20.46.amzn1.x86_64
127723 error argv "/opt/elasticbeanstalk/node-install/node-v4.4.3-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v4.4.3-linux-x64/bin/npm" "--production" "install"
127724 error node v4.4.3
127725 error npm  v2.15.1
127726 error code ENOMEM
127727 error errno ENOMEM
127728 error syscall spawn
127729 error spawn ENOMEM
127730 error If you need help, you may report this error at:
127730 error     <https://github.com/npm/npm/issues>
127731 verbose exit [ 1, true ]

如果我将实例大小增加到 t2.small,也会发生这种情况。这些实例是否不足以安装 KeystoneJS?

【问题讨论】:

  • 有同样的问题,但安装 dtrace-provider :/

标签: node.js amazon-web-services amazon-elastic-beanstalk keystonejs


【解决方案1】:

这可能是您的 gitignore / npmignore 的问题。我会尝试在您的项目根目录中放置一个黑色的 .npmignore。

如果项目中没有.npmignore,npm默认使用.gitignore

https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package

StackOverflow 参考:npm install errors with Error: ENOENT, chmod

【讨论】:

  • 很遗憾,这并没有解决问题。
猜你喜欢
  • 2018-11-09
  • 2021-01-19
  • 2020-08-19
  • 2015-06-28
  • 2013-03-05
  • 2019-11-22
  • 1970-01-01
  • 2018-05-25
  • 2017-03-11
相关资源
最近更新 更多