parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

No such file or directory for package.json

Open farhan-syed opened this issue 9 years ago • 11 comments

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.

farhan-syed avatar Jul 22 '17 00:07 farhan-syed

Maybe Parse Server is using features of node latest. what you think about using node 8.* or 7.*?

daviddguedes avatar Jul 22 '17 10:07 daviddguedes

@daviddguedes How do I make AWS Beanstalk use a higher node verison?

farhan-syed avatar Jul 22 '17 10:07 farhan-syed

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?

daviddguedes avatar Jul 22 '17 10:07 daviddguedes

Seems that the upload was unsuccesful as it can’t find the package.json file, not related to node version.

flovilmart avatar Jul 22 '17 14:07 flovilmart

@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?

farhan-syed avatar Jul 22 '17 23:07 farhan-syed

@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.

farhan-syed avatar Jul 23 '17 21:07 farhan-syed

Which is probably why it’s not working as expected

flovilmart avatar Jul 23 '17 22:07 flovilmart

@flovilmart what's the best solution? I tried deploying via .zip and via terminal and I still get the error message.

farhan-syed avatar Jul 24 '17 08:07 farhan-syed

@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.

agwl-saurabh avatar Sep 28 '17 13:09 agwl-saurabh

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.

stale[bot] avatar Sep 18 '18 11:09 stale[bot]

This issue is because of the directory structure. For beanstalk nodejs deployment, the top level folder should be containing package.json file

iamvajid avatar Dec 25 '18 20:12 iamvajid