简体   繁体   中英

showing Failed to find package.json. Node.js may have issues starting. Verify package.json is valid or place code in a file named server.js or app.js

showing Failed to find package.json. Node.js may have issues starting. Verify package.json is valid or place code in a file named server.js or app.js. when deploying node js file in AWS ELASTIC BEANSTALK cloud, what are the reasons to showing that message and how to resolve that issue.

There can be multiple reasons. Can you please check the logs generated in Beanstalk. The way how you have zipped the package can cause an error. Make sure, you go inside the source directory and zip the files and folders, instead of zipping the single folder itself.

Secondly, the way how you have created the app.js or index.js.

The Nodejs versions can be another reason.

The below approach worked for me 2 years back when I started using Beanstalk for my Nodejs applications.

Also, I would recommend deploying a sample nodejs application from this link and progressing from there. https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/nodejs-getstarted.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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