2017-10-20 112 views
0

我最近开始学习Node,我成功运行了我的第一个节点应用程序,但没有使用nodemon。我安装nodemon全球使用npm install -g nodemon,并成功安装.. 如果我再运行nodemon index我看到以下错误 [nodemon] 1.12.1 [nodemon] to restart at any time, enter RS [nodemon] watching: *.* [nodemon] starting ``node index index.js events.js:182 throw er; // Unhandled 'error' event ^我无法在我的windows上启动nodemon 10

`Error: spawn cmd ENOENT 
at _errnoException (util.js:1019:11) 
at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19) 
at onErrorNT (internal/child_process.js:374:16) 
at _combinedTickCallback (internal/process/next_tick.js:138:11) 
at process._tickCallback (internal/process/next_tick.js:180:9) 

` 请您的建议将理解

+0

它不是这个问题的depulicate,这个问题确实的末尾添加C:\Windows\System32\到PATH环境变量没有解决我的问题,但由@Jackowski给出的解决方案解决了我的问题 –

+0

,那么你显然错过了问题的确切错误代码的位置。和明确提到缺少System32文件夹的PATH的答案(https://stackoverflow.com/a/34083398/1657476)。 –

回答

0

检查您的PATH变量是否包含:C:\Windows\System32\。如果没有,请添加它。

+0

非常感谢,这解决了我的问题,并且Nodemon现在完美运行 –

0

它是一个路径问题

在行

**`Verify the npm folder exists at the following location C:\Users\My-UserName\AppData\Roaming\npm`** 

Try to run npm cache clean 
+0

非常感谢,这解决了我的问题 –