Kos*_*ukh 3 amazon-web-services node.js amazon-elastic-beanstalk npm-install
我尝试使用命令行工具在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,没有任何问题.
我有一个类似的问题,但没有使用eb部署,并没有包括node_modules/在包中.为我工作的解决方案是建立unsafe-perm=true在.npmrc-看魔豆:Node.js的部署-节点GYP失败,因为权限被拒绝
花了一整天调试这个错误。事实证明,您的 .ebignore 文件中的目录需要一个尾部斜杠。
.eignore
node_modules/
Run Code Online (Sandbox Code Playgroud)
如果没有尾部斜杠,您的本地 node_modules 文件夹将由 eb 上传 - 包括开发依赖项。
| 归档时间: |
|
| 查看次数: |
3595 次 |
| 最近记录: |