I'm very new with amazon web services, and I am trying to set up a node.js app on their elastic beanstalk. I set up the instance and uploaded/deployed the site, but while the health is "Ok" the node.js logs show this repeated about 30 times:
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 npm ERR! Please include the following file with any support request: npm ERR! /var/app/current/npm-debug.log npm ERR! Linux 4.1.13-19.31.amzn1.x86_64 npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v4.2.3-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v4.2.3-linux-x64/bin/npm" "start" npm ERR! node v4.2.3 npm ERR! npm v2.14.7 npm ERR! path /var/app/current/package.json npm ERR! code ENOENT npm ERR! errno -2 npm ERR! syscall open
The problem is that my package.json does exist because I generated one with npm init. Any ideas on why it cant be found? Here is the package.json
{ "name": "testwebsite", "version": "0.0.1", "scripts": { "start": "node server.js" }, "dependencies": { "body-parser": "^1.13.3", "express": "^4.13.3", "express-session": "~1.0.0", "socket.io": "^1.3.7" }, "description": "my website", "author": "Matt", "engines": { "node": ">=0.10.0" }, "main": "server.js", "devDependencies": {}, "license": "ISC" }
The package. json file is normally located at the root directory of a Node. js project. The name field should explain itself: this is the name of your project.
Use the engines keyword in the package. json file to specify the Node. js version that you want your application to use. You can also specify a version range using npm notation.
From an official AWS thread[1], it appears (and this was my problem) that you might be zipping the top-level directory rather than zipping the source itself.
For example, you may have all of your files in a folder called "Project". Rather than zipping "Project", you should zip and upload the contents of "Project".
[1] https://forums.aws.amazon.com/thread.jspa?messageID=476022
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With