i am totally new to node.js and mongodb. I am using the following link: http://cwbuecheler.com/web/tutorials/2013/node-express-mongo/ This procedure worked very fine and got the exact same results. But all of a sudden "npm start" stopped working. I uninstalled every thing and trying to re-install from step 1 given in this tutorial. when i give the command "npm install -g express" i am not getting any list of http 304's and GETS!! . As i ignore and continue the procedure, i give the command npm start , but it does not work. the error displayed is shown below C:\project\nodetest1>npm start
> nodetest1@0.0.0 start C:\project\nodetest1
> node ./bin/www
npm ERR! nodetest1@0.0.0 start: `node ./bin/www`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the nodetest1@0.0.0 start script.
npm ERR! This is most likely a problem with the nodetest1 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./bin/www
npm ERR! You can get their info via:
npm ERR! npm owner ls nodetest1
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! cwd C:\project\nodetest1
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! syscall spawn
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! nodetest1@0.0.0 start: `node ./bin/www`
npm ERR! Exit status -1
npm ERR!
npm ERR! Failed at the nodetest1@0.0.0 start script.
npm ERR! This is most likely a problem with the nodetest1 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./bin/www
npm ERR! You can get their info via:
npm ERR! npm owner ls nodetest1
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\ProgramFiles\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! cwd C:\project\nodetest1
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\project\nodetest1\npm-debug.log
npm ERR! not ok code 0
Please help . Thanks in advance.
The package.json is telling npm that start means "run node ./bin/www". **but packege.json predefined staring script is npm run serve **
please try this one.
npm run serve
"start": "concurrently \"npm run build:watch\" \"npm run serve\""
The error suggests that the ./bin/www directory is not found. Paths specified with a dot are relative to the current directory, so your current directory has to be C:/project/nodetest1 for
npm start
to work in this case.There are several issues here.
First, you should upgrade to a newer
npm
, as thenpm
that ships with even the latest version ofnode
is out of date. To upgradenpm
on Windows, follow the instructions here: https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windowsSecond, you may need to do some more troubleshooting on your own to find the problem.
npm start
just follows the instructions in thepackage.json
. The package.json is tellingnpm
thatstart
means "run node ./bin/www".What happens when you run that same script from the command line?
Does the file 'bin/www' exist? Is node installed and in your path? These are the issues that you will have to troubleshoot.
Delete the node_modules folder. Run
npm install
And then, re-run your commandnpm start