javascript - Node Nodemon Error: Cannot find module 'C:Program Filesnodejsnode_modulesnodemonbin' - Stack Overfl

When i tried to execute server.js file using nodemon it is showing error.C:UsersgouravWebstormProjec

When i tried to execute server.js file using nodemon it is showing error.

C:\Users\gourav\WebstormProjects\Node.js-Register-Login-App-master>nodemon server.js

internal/modules/cjs/loader.js:584

throw err; ^

Error: Cannot find module 'C:\Users\gourav\AppData\Roaming\npm\node_modules\nodemon\bin\nodemon.js'

at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)

at Function.Module._load (internal/modules/cjs/loader.js:508:25)


at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)

at startup (internal/bootstrap/node.js:283:19)

at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

npm ERR! file C:\WINDOWS\system32\cmd.exe;C:\Program Files\Java\jdk1.8.0_161\bin;C:\Program Files\nodejs\node_modules\npm\bin;

npm ERR! path C:\WINDOWS\system32\cmd.exe;C:\Program Files\Java\jdk1.8.0_161\bin;C:\Program Files\nodejs\node_modules\npm\bin;

npm ERR! code ELIFECYCLE \ npm ERR! errno ENOENT

npm ERR! syscall spawn C:\WINDOWS\system32\cmd.exe;C:\Program Files\Java\jdk1.8.0_161\bin;C:\Program Files\nodejs\node_modules\npm\bin;

npm ERR! [email protected] start: nodemon server.js

npm ERR! spawn C:\WINDOWS\system32\cmd.exe;C:\Program Files\Java\jdk1.8.0_161\bin;C:\Program Files\nodejs\node_modules\npm\bin; ENOENT

npm ERR!

npm ERR! Failed at the [email protected] start script.

npm ERR! This is probably not a problem with npm. There is likely additional

logging output above.

npm ERR! A plete log of this run can be found in:

npm ERR! C:\Users\gourav\AppData\Roaming\npm-cache_logs\2019-03-

19T20_31_26_905Z-debug.log

When i tried to execute server.js file using nodemon it is showing error.

C:\Users\gourav\WebstormProjects\Node.js-Register-Login-App-master>nodemon server.js

internal/modules/cjs/loader.js:584

throw err; ^

Error: Cannot find module 'C:\Users\gourav\AppData\Roaming\npm\node_modules\nodemon\bin\nodemon.js'

at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)

at Function.Module._load (internal/modules/cjs/loader.js:508:25)


at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)

at startup (internal/bootstrap/node.js:283:19)

at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

npm ERR! file C:\WINDOWS\system32\cmd.exe;C:\Program Files\Java\jdk1.8.0_161\bin;C:\Program Files\nodejs\node_modules\npm\bin;

npm ERR! path C:\WINDOWS\system32\cmd.exe;C:\Program Files\Java\jdk1.8.0_161\bin;C:\Program Files\nodejs\node_modules\npm\bin;

npm ERR! code ELIFECYCLE \ npm ERR! errno ENOENT

npm ERR! syscall spawn C:\WINDOWS\system32\cmd.exe;C:\Program Files\Java\jdk1.8.0_161\bin;C:\Program Files\nodejs\node_modules\npm\bin;

npm ERR! [email protected] start: nodemon server.js

npm ERR! spawn C:\WINDOWS\system32\cmd.exe;C:\Program Files\Java\jdk1.8.0_161\bin;C:\Program Files\nodejs\node_modules\npm\bin; ENOENT

npm ERR!

npm ERR! Failed at the [email protected] start script.

npm ERR! This is probably not a problem with npm. There is likely additional

logging output above.

npm ERR! A plete log of this run can be found in:

npm ERR! C:\Users\gourav\AppData\Roaming\npm-cache_logs\2019-03-

19T20_31_26_905Z-debug.log

Share Improve this question edited Mar 20, 2019 at 2:37 Gourav Kumar burnwal asked Mar 19, 2019 at 20:44 Gourav Kumar burnwalGourav Kumar burnwal 312 silver badges6 bronze badges 3
  • have you installed nodemon globally to your npm version? – jakemingolla Commented Mar 19, 2019 at 20:47
  • 2 Did you install it with npm install -g nodemon (don't miss the -g ...) ? – Jonas Wilms Commented Mar 19, 2019 at 20:47
  • Yes as the mand u have said I tried to install but it is not getting installed. I have tried both locally as well as globally but not getting the result – Gourav Kumar burnwal Commented Mar 20, 2019 at 2:38
Add a ment  | 

3 Answers 3

Reset to default 3

Just go to the path and delete everything with the name of nodemon,even within the folders, then install nodemon again globally. This worked just fine for me.

I did the below:

  1. npx mand ==> npm install -g nodemon
  2. in package.json file ==> "start": "nodemon server.js"
  3. in terminal used ==> nodemon app.js (app.js is my root file here)
Install npm gloabally by running this mand 
npm install -g nodemon
if you are using linux then run below mand 
sudo npm install -g nodemon

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744786251a4593644.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信