【发布时间】:2016-07-08 13:33:28
【问题描述】:
我正在尝试使用命令行工具在 Elastic Beanstalk 上安装一个简单的 Node.js 应用程序。
在我的 git 存储库中,我运行命令
$ eb deploy
部署我的 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
我尝试了各种方法,例如:
- 自己创建目录(目录归根用户所有)。
- 从 /tmp 中删除所有内容,以便下次它自行修复。
- 删除我的 node_modules 目录。
这些选项都不起作用,我找不到解决方法或发生这种情况的原因。我可以在本地运行 node.js 应用程序,也可以毫无问题地将其部署到 Azure 和 Heroku。
【问题讨论】:
-
我也遇到了同样的问题,你有什么发现吗?建议的答案不是我的问题
-
我已经弄清楚了,一个模块试图在 package.json 的
preinstall部分中使用npm install安装另一个模块。希望这也是你的问题。 -
我通过不在 git 存储库中签入
node_modules解决了我的问题。npm install自动创建它们。
标签: node.js amazon-web-services amazon-elastic-beanstalk npm-install