我是node.js的新手.node工作正常,但是当我安装nodemon软件包时,它会出错:exception in nodemon killing node即使全局安装也是如此.
22 Jun 13:07:29 - [nodemon] v1.3.7
22 Jun 13:07:29 - [nodemon] to restart at any time, enter `rs`
22 Jun 13:07:29 - [nodemon] watching: *.*
22 Jun 13:07:29 - [nodemon] starting `node server.js`
exception in nodemon killing node
Error: spawn cmd ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
at child_process.js:1144:20
at process._tickCallback (node.js:355:11)
----------------------------------------------------------
If appropriate, please file an error with the output from:
$ node
C:\Users\username\AppData\Roaming\npm\node_modules\nodemon\bin\nodemon.
js server.js --dump
At http://github.com/remy/nodemon/issues/new
Run Code Online (Sandbox Code Playgroud)
小智 7
可能的解决方案.
1.权限
您的文件权限可能有问题.在git bash或windows中执行,以获得项目文件夹的完全权限.
$ chmod -R 777 [folder]
Run Code Online (Sandbox Code Playgroud)
2.环境变量
在PATH中缺少"C:\ Windows\System32 \".
3.重新安装
使用npm完全删除nodemon并尝试重新安装.
npm uninstall -g nodemon
Run Code Online (Sandbox Code Playgroud)
4.更新nodejs
如果您有旧版本的nodejs,请尝试更新它.我更喜欢完全删除nodejs并重新安装它.
注意:您的问题可能不够丰富,无法给出正确答案.如果这2个解决方案不起作用,请包含有关该问题的更多信息.