Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 I try to upload my Node.js project on Elastic Beanstalk I obtain the following error:

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.

However, I have the package.json in the main directory.

like image 700
Michele Spina Avatar asked Dec 17 '13 12:12

Michele Spina


2 Answers

A couple of people were zipping the parent folder incorrectly. You need to select all the contents of the folder and zip those.

https://forums.aws.amazon.com/message.jspa?messageID=477087 https://forums.aws.amazon.com/thread.jspa?threadID=130140&tstart=0

like image 189
Federico Avatar answered Sep 19 '22 20:09

Federico


While uploading the .zip file (Nodejs application) we need to select all the files in the folder, then zip it as shown in below screenshot.

Then upload the Nodejs(zip file) project in AWS Elastic Beanstalck.

enter image description here

like image 31
Chandra Sekhar Avatar answered Sep 19 '22 20:09

Chandra Sekhar