question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ENOENT error for spawning child processes

See original GitHub issue

Hey @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:closed
  • Created 7 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
mfix22commented, Mar 11, 2017

Actually, I am with you there. Thanks for challenging my point, I agree!

1reaction
ntwcklngcommented, Mar 11, 2017

Okay, defaults to use the .js extension would break a lot of projects. Whats wrong with npm link and adding the binaries to package.json? Then you can also test your bins with node ./bin/gest-test.js

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found