您的AWS Elastic Beanstalk部署失败: - 间歇性 - 没有明显的原因
第1步:检查明显的日志
/var/log/eb-activity.log
Running npm install: /opt/elasticbeanstalk/node-install/node-v6.10.0-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 <module>
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-v6.10.0-linux-x64/bin/npm', '--production', 'install']' …Run Code Online (Sandbox Code Playgroud) out-of-memory amazon-web-services node.js enomem amazon-elastic-beanstalk
我正在尝试将 GRPC 依赖项添加到节点弹性 beanstalk 应用程序,但我的所有部署都失败了。一旦我从package.json我的部署工作中删除了 GRPC 依赖项。
错误是
ERROR: Failed to run npm install.
> grpc@1.10.1 install /tmp/deployment/application/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp ERR! Pre-built binaries not installable for grpc@1.10.1
and node@8.9.3 (node-v57 ABI, glibc) (falling back to source compile
with node-gyp)
node-pre-gyp ERR! Hit error EACCES: permission denied, mkdir
'/tmp/deployment/application/node_modules/grpc/src/node'
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied
Run Code Online (Sandbox Code Playgroud)
我在另一个节点应用程序上遇到了这个问题,并且能够通过运行来解决它,npm --save-dev eb-fix-npm但它不适用于这个应用程序。我有时也会收到类似“无法创建符号链接,文件已经存在(释义)”的错误。
我也设置了这个文件来尝试解决这个问题。
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh" :
mode: "000775"
owner: root
group: root …Run Code Online (Sandbox Code Playgroud) amazon-ec2 amazon-web-services node.js amazon-elastic-beanstalk grpc
我尝试使用命令行工具在Elastic Beanstalk上安装一个简单的Node.js应用程序.
在我的git存储库中,我运行命令
$ eb deploy
Run Code Online (Sandbox Code Playgroud)
部署我的git存储库的内容.它部署正常,但应用程序的运行状况为红色.
如果我查看Elastic Beanstalk网站上的日志,它会指出日志中出现以下错误:
> fsevents@1.0.8 install /tmp/deployment/application/node_modules/nodemon/node_modules/chokidar/node_modules/fsevents
> node-pre-gyp install --fallback-to-build
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/tmp/deployment/application/node_modules/nodemon/node_modules/chokidar/node_modules/fsevents/build'
gyp ERR! stack at Error (native)
gyp ERR! System Linux 4.1.17-22.30.amzn1.x86_64
gyp ERR! command "/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/tmp/deployment/application/node_modules/nodemon/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v46-linux-x64/fse.node" "--module_name=fse" "--module_path=/tmp/deployment/application/node_modules/nodemon/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v46-linux-x64"
gyp ERR! cwd /tmp/deployment/application/node_modules/nodemon/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v4.3.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
Run Code Online (Sandbox Code Playgroud)
我试过各种各样的事情:
这些选项都不起作用,我找不到解决方法或原因.我可以在本地运行node.js应用程序,并将其部署到Azure和Heroku,没有任何问题.
amazon-web-services node.js amazon-elastic-beanstalk npm-install
我正在尝试将NodeJS应用程序上传到Amazon AWS中的Elastic Beanstalk。但是,当执行npm install时,它会引起一些权限被拒绝,因此无法运行该应用程序。这是日志
Application update failed at 2018-10-02T15:18:14Z 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 deprecated tar.gz@1.0.7: ?? WARNING ?? tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
npm WARN deprecated fs-promise@2.0.3: Use mz or fs-extra^3.0 with Promise Support
> scrypt@6.0.3 preinstall /tmp/deployment/application/node_modules/scrypt
> node node-scrypt-preinstall.js
Error: Error: Command failed: ./configure
./configure: line 1904: config.log: Permission denied
./configure: line 1914: config.log: Permission denied …Run Code Online (Sandbox Code Playgroud) permission-denied amazon-web-services node.js amazon-elastic-beanstalk npm-install
任何人都可以帮助我摆脱以下错误 -
WARN install EACCES: permission denied, access '/tmp/.npm'
gyp ERR! clean error
gyp ERR! stack Error: EACCES: permission denied, rmdir 'build/bindings'
gyp ERR! System Linux 4.14.123-86.109.amzn1.x86_64
gyp ERR! command "/opt/elasticbeanstalk/node-install/node-v10.16.0-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v10.16.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /tmp/deployment/application/node_modules/iltorb
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! iltorb@2.4.3 install: `node ./scripts/install.js || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the …Run Code Online (Sandbox Code Playgroud)