【发布时间】:2015-02-25 15:15:08
【问题描述】:
当我收到以下错误时:
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1000:11)
at Process.ChildProcess._handle.onexit (child_process.js:791:34)
我可以按照什么程序来修复它?
作者注:很多与此错误有关的问题促使我发布此问题以供将来参考。
相关问题:
- using spawn function with NODE_ENV=production
- node.js child_process.spawn ENOENT error - only under supervisord
- spawn ENOENT node.js error
- https://stackoverflow.com/questions/27603713/nodejs-spawn-enoent-error-on-travis-calling-global-npm-package
- Node JS - child_process spawn('npm install') in Grunt task results in ENOENT error
- Running "foreman" task Fatal error: spawn ENOENT
- unhandled error event in node js Error: spawn ENOENT at errnoException (child_process.js:975:11)
- Node.js SpookyJS: error executing hello.js
- https://stackoverflow.com/questions/26572214/run-grunt-on-a-directory-nodewebkit
- Run exe file with Child Process NodeJS
- Node: child_process.spawn not working on Java even though it's in the path (ENOENT)
- spawn ENOENT error with NodeJS(与 Python 相关)
- image resizing is not working in node.js (partial.js)(未安装依赖)
- npm install error ENOENT(构建依赖问题)
- Cannot install node.js - oracle module on Windows 7(构建依赖问题)
- Error installing gulp using nodejs on windows(奇怪的情况)
【问题讨论】:
-
在我的例子中,我将整个命令作为字符串传递,就像你使用
exec一样,而不是将命令作为第一个参数传递,将选项作为第二个参数的数组传递。例如我在做spawn( "adb logcat -c" )而不是spawn( "adb", [ "logcat", "-c" ] )。
标签: node.js debugging error-handling child-process spawn