Npm starts giving error in node.js

I am completely 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 well and got accurate results. But suddenly "npm start" stopped working. I uninstalled everything and tried to reinstall from step 1 given in this tutorial. when i give the command "npm install -g express" i dont get the http 304 and GETS list !! as i ignore and continue the procedure i give npm start command but it doesnt work. the displayed error shows 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.

+3


source to share


5 answers


The error indicates that the directory. / bin / www not found. The paths given by dot are relative to the current directory, so for this to work, your current directory must be C: / project / nodetest1 for npm start

.



+1


source


There are several problems here.

First, you must upgrade to the new one npm

, as the npm

one that comes with the latest version node

is outdated. To update npm

on Windows, follow these steps: https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows

Second, you may need to do a few more problems to find the problem. npm start

just follows the instructions in package.json

. Pack.json tells npm

what it start

means to "run node./bin/www".



What happens if you run the same script from the command line?

cd C: \ project \ nodetest1 node./bin/www

Does bin / www file exist? Is node installed and in your path? These are problems that you will have to fix.

+1


source


Delete the node_modules folder. Run npm install

Then restart the commandnpm start

0


source


package.json tells npm that the beginning means "run node./bin/www". ** but the packege.json predefined view script is npm run serve **

try this option.

npm run serve

"start": "concurrently \"npm run build:watch\" \"npm run serve\""

0


source


Microsoft Windows [Version 10.0.17134.706] (c) 2018 Microsoft Corporation. All rights reserved.

C: \ Users \ Haseeb> D:

D:> CD react to project

D: \ react to project> cd myapp

D: \ react to project \ myapp> npm run npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C: \ Program Files (x86) \ nodejs \\ node.exe" "C: \ Program Files (x86) \ nodejs \ node_modules \ npm \ bin \ npm-cli.js" "start" npm ERR! node v0.12.2 npm ERR! npm v2.7.4 npm ERR! path D: \ react to project \ myapp \ package.json npm ERR! ENOENT code npm ERR! errno -4058

npm ERR! enoent ENOENT, open 'D: \ react project \ myapp \ package.json' npm ERR! enoent This is most likely not a problem with npm ERP ERP itself! enoent and is due to the fact that npm cannot find the file. npm ERR! ENOENT

npm ERR! Please include the following file with any support request: npm ERR! D: \ react to project \ myapp \ npm-debug.log

D: \ react to project \ myapp> please help me fix this

0


source







All Articles