ENOENT error for spawning child processes
See original GitHub issueHey @leo, This fix might not be necessary, but when I created my first args subcommand I got:
Error: spawn gest-test ENOENT
at exports._errnoException (util.js:1028: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)
...
and addingpath.join(__dirname, this.binary + '-' + (Array.isArray(details.usage) ? details.usage[0] : details.usage))
was my quick fix, but this only fixed the problem if I named my binary gest-test
, not gest-test.js
. A better solution would be to only spawn the file mapped to by package.json
’s bin
, or maybe default to .js
.
I can tackle this, but I would like to know which approach you think is best. – @mfix22
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
spawn node ENOENT" when using child_process in Node.js
The reason the spawn was broken in the first place was because we were overriding the child process' environment variables in options.env which ......
Read more >How to catch ENOENT error when spawning a child process ...
I'm trying to create a child process, using spawn, and would like to be able to handle if the "cwd" is not found....
Read more >Error spawning child process ENOENT · Issue #485 - GitHub
After installing the Rust (rls) extension and opening a rust source file the rustup process fails to spawn as a child process.
Read more >Node.js Child Process ENOENT Error on Windows ... - Medium
Turns out this ENOENT error means that it can't execute the command. eg. Jekyll doesn't resolve to an executable file. When we run...
Read more >[Solved-5 Solutions] Error spawn enoent on node.js - Wikitechy
Spawn may emit the ENOENT error if the filename command (i.e, 'some-command') does not exist in at least one of the directories defined...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Actually, I am with you there. Thanks for challenging my point, I agree!
Okay, defaults to use the
.js
extension would break a lot of projects. Whats wrong withnpm link
and adding the binaries topackage.json
? Then you can also test your bins withnode ./bin/gest-test.js