Adam.V
Adam.V

Reputation: 789

Elastic Beanstalk fails at start script

I'm trying to deploy a Node.js app to elastic beanstalk. The problem is, it fails at the start script every time. I have ec2 configured to use the start script npm start, which executes node app.js (defined in package.json). However, this start script fails in ec2. I get the logged error,

npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the myProject start script 'node app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the Portfolio package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs myProject
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls myProject
npm ERR! There is likely additional logging output above.

What does this mean? Running npm start on my command line in the root directory of the same app that was zipped to AWS works fine, running on localhost. I also have updated both npm and node.js

Here is the file structure zipped to deploy:

.zip

Upvotes: 3

Views: 1741

Answers (1)

Devon Katz
Devon Katz

Reputation: 256

I faced a problem with similar symptoms on Elastic Beanstalk which was caused by missing npm dependencies. Some dependencies were installed locally in node_modules, but one or two we're installed globally, causing them not to be packaged when zipping for deployment. Unfortunately Elastic Beanstalk's error message is less than helpful in this case and gives a generic error.

Upvotes: 3

Related Questions