No such file or directory for package.json
Hello,
I have simply created a AWS Elastic Beanstalk app, then uploaded the parse-server-example.
I looked at the logs via eb logs and noticed this:
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /var/app/current/npm-debug.log
npm ERR! Linux 4.9.32-15.41.amzn1.x86_64
npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v6.11.1-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v6.11.1-linux-x64/bin/npm" "start"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! path /var/app/current/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/var/app/current/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/var/app/current/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
Keep in mind, I haven't even touched a line of code of the parse-server-example.
I directed into the parse-server-example and did eb deploy from inside the folder.
Maybe Parse Server is using features of node latest. what you think about using node 8.* or 7.*?
@daviddguedes How do I make AWS Beanstalk use a higher node verison?
Did you see already this docs http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/nodejs-devenv.html#nodejs-devenv-nodejs and http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.platform.upgrade.html?
Seems that the upload was unsuccesful as it can’t find the package.json file, not related to node version.
@flovilmart What I did was I git cloned the parse-server-example. Then created a beanstalk app. Then via terminal I deployed it while being in the parse-server-example folder.
Is that correct?
@flovilmart I've also noticed when using the AWS deploy button, it doesn't actually upload the parse-server-example.zip. It actually uses the default AWS sample file for EB.
Which is probably why it’s not working as expected
@flovilmart what's the best solution? I tried deploying via .zip and via terminal and I still get the error message.
@farhansyed9 This is very simple issue . your zip folder does not have package.json on root folder of the zip file. for example if you download zip file from git then right click and click "unzip here" (window machine) all file should come to current folder not in new folder like parse-server-example. I had same issue when i was creating new server and learned after deleting 20 server.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue is because of the directory structure. For beanstalk nodejs deployment, the top level folder should be containing package.json file