Reputation: 31
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 complete 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
Upvotes: 3
Views: 4261
Reputation: 2095
Install npm gloabally by running this command
npm install -g nodemon
if you are using linux then run below command
sudo npm install -g nodemon
Upvotes: 0
Reputation: 31
I did the below:
Upvotes: 3
Reputation: 47
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.
Upvotes: 3