Node script throws uv_signal_start EINVAL

匿名 (未验证) 提交于 2019-12-03 01:38:01

问题:

I'm running Ubuntu 12.10 and getting started with Node.

I first installed node using the Ubuntu repositories. I ran into some trouble with something, so I re-installed using Chris Lea's repository. After that, node was running better, without that previous error.

Then I ran sudo npm install node-dev -g

But running node-dev script.js wasn't working.

Error: node.js:762           throw errnoException(process._errno, 'uv_signal_start');                 ^ Error: uv_signal_start EINVAL     at errnoException (node.js:540:13)     at process.on.process.addListener (node.js:762:17)     at spawn.cwd (/usr/local/lib/node_modules/node-dev/node-dev:52:11)     at Array.forEach (native)     at Object.<anonymous> (/usr/local/lib/node_modules/node-dev/node-dev:51:25)     at Module._compile (module.js:456:26)     at Object.Module._extensions..js (module.js:474:10)     at Module.load (module.js:356:32)     at Function.Module._load (module.js:312:12)     at Function.Module.runMain (module.js:497:10) 

回答1:

The error isn't with node-dev, but rather in your script. Error: uv_signal_start EINVAL is thrown in newer versions of node when you're trying to work with SIGKILL or SIGSTOP, like so:

process.on('SIGKILL', function() { // etc, etc 

You probably got away with this in earlier versions, but newer versions will now throw this error (see this GitHub issue for details).



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!