Reputation: 31
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
> [email protected] start C:\project\nodetest1
> node ./bin/www
npm ERR! [email protected] start: `node ./bin/www`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] 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! [email protected] start: `node ./bin/www`
npm ERR! Exit status -1
npm ERR!
npm ERR! Failed at the [email protected] 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.
Upvotes: 3
Views: 42947
Reputation: 465
One of the possible situation causing this problem might be that the command npm start
is giving error is because the current directory that you are in right now and the react app directory is not same. Try navigating your command prompt to the react app location using cd ./your react app location/
Upvotes: 0
Reputation: 9
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\""
Upvotes: 0
Reputation: 136
Delete the node_modules folder.
Run npm install
And then, re-run your command npm start
Upvotes: 1
Reputation: 10818
There are several issues here.
First, you should upgrade to a newer npm
, as the npm
that ships with even the latest version of node
is out of date. To upgrade npm
on Windows, follow the instructions here:
https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows
Second, you may need to do some more troubleshooting on your own to find the problem. npm start
just follows the instructions in the package.json
. The package.json is telling npm
that start
means "run node ./bin/www".
What happens when you run that same script from the command line?
cd C:\project\nodetest1 node ./bin/www
Does the file 'bin/www' exist? Is node installed and in your path? These are the issues that you will have to troubleshoot.
Upvotes: 1
Reputation: 51
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.
Upvotes: 1