简体   繁体   English

events.js:160 throw er; //未处理的'错误'事件^

[英]events.js:160 throw er; // Unhandled 'error' event ^

I think I did something and broke node. 我想我做了一些事情并打破了节点。 I have tried changing paths, but don't really know what I'm doing and don't want to make the problem worse. 我试过改变路径,但不知道我在做什么,也不想让问题变得更糟。 Tried uninstalling and reinstalling node all to no avail. 尝试卸载并重新安装节点都无济于事。 Any help or ideas would be great. 任何帮助或想法都会很棒。

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.

[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node ./bin/www start`
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: spawn cmd ENOENT
    at exports._errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Found out I was setting the port twice, once in app.js and once in .bin/www so after commenting one out it now deploys successfully! 发现我正在设置端口两次,一次在app.js中,一次在.bin / www中,所以在评论一次之后它现在已成功部署! So i was just being a melon. 所以我只是一个甜瓜。 Hope this helps someone else! 希望这有助于其他人!

I was too getting this error. 我也得到了这个错误。

I read all the answers here in stackoverflow, nothing worked out. 我在stackoverflow中阅读了所有答案,没有任何结果。 A lot of the answers mentions that you go to PATH variable and add "C:\\Windows\\System32\\" 很多答案都提到你转到PATH变量并添加“C:\\ Windows \\ System32 \\”

I did that too. 我也这样做了。 It didn't worked out at first. 它起初并没有成功。 What you have to do is to add the above in the User Variables > PATH > add "C:\\Windows\\System32\\" 你要做的是在User Variables > PATH > add "C:\\Windows\\System32\\"添加上述内容

After that change the port number and then restart your system. 之后更改端口号,然后重新启动系统。

For me doing the above steps solved the problem. 对我来说,上述步骤解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM