简体   繁体   English

带有node.js的Elastic Beanstalk启动错误

[英]Elastic Beanstalk with node.js start error

I'm getting an error when trying to run a node.js app in elastic beanstalk. 尝试在弹性beantalk中运行node.js应用程序时出现错误。 I followed the instructions here for an express app, but when I inspect the node.js logs, I can see the node process exits with a permissions error. 我按照此处针对快速应用程序的说明进行操作,但是当我检查node.js日志时,我可以看到节点进程退出并出现权限错误。 I'm not sure what to do here? 我不确定在这里做什么?

> express-test@0.0.1-52 start /var/app/current
> src/server.js

sh: src/server.js: Permission denied

npm ERR! express-test@0.0.1-52 start: `src/server.js`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the express-test@0.0.1-52 start script.
npm ERR! This is most likely a problem with the express-test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     src/server.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls express-test
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.10.35-43.137.amzn1.x86_64
npm ERR! command "/opt/elasticbeanstalk/node-install/node-v0.10.26-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v0.10.26-linux-x64/bin/npm" "start"
npm ERR! cwd /var/app/current
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.4
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /var/app/current/npm-debug.log
npm ERR! not ok code 0

What do you have in your package.json file in the scripts section? 您在scripts部分的package.json文件中有什么?

I'm guessing you forgot to put the beginning part of the command and instead it is trying to execute server.js, which is a js file and isn't executable. 我猜想您忘记了将该命令的开头部分,而是尝试执行server.js,这是一个js文件,无法执行。

Instead, try: 相反,请尝试:

"scripts": {
    "start": "node server.js"
  },

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM