nodemon 2.0.2 package didn't work on windows 10
Closed this issue · 2 comments
for some windows specific reason, nodemon v2.0.2 kept complaining for below error. Any idea what could be the problem how to fix?
I get the same error for nodemon latest package as well 2.0.3.
D:\Projects\AddressBook\server\node_modules\chokidar\index.js:904
const options = {type: EV_ALL, alwaysStat: true, lstat: true, ...opts};
^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:74:10)
at Object.runInThisContext (vm.js:116:10)
at Module._compile (module.js:533:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object. (D:\Projects\AddressBook\server\node_modules\nodemon\lib\monitor\watch.js:6:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server@1.0.0 start-dev: nodemon --watch index.js --v
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server@1.0.0 start-dev 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\mehul\AppData\Roaming\npm-cache_logs\2020-04-25T05_03_14_253Z-debug.log
I had a similar problem, I went around this by installing nodemon globally npm install -g nodemon
and not using the dev script. to run this I simply used nodemon server.js
instead of node server.js
I recommend you try WSL if you're on Windows. Read this article for how to do this: https://zellwk.com/blog/windows-wsl/