Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Write/use a version of spawn that tells you what it tried to spawn in the error message #3908

domenic opened this Issue · 12 comments

7 participants


It is horrible for users to get error messages telling them "spawn ENOENT" with no idea what npm was trying to spawn.


Because I was quite unhappy with messing around with the events I talked to some of the node core people, they seem to like the feature.

So if anyone knows C++ better than me, please see nodejs/node-v0.x-archive#6659 - it would be a huge help for providing support for npm in the daily work. And alot of other projects would benefit, too.


Good news @domenic - this feature landed in May in Node.js and is still not released (it is merged to master)




Yayyyy!! Except for the fact that Node 0.12 will probably be released only after the stars have burnt out their nuclear fuel and spent themselves into mere cosmic ashes. Boooo about that.


What an ill-timed thumbs up! I missed @domenic's totally cheerful comment by milliseconds, lol. On that timeline, I guess we can look forward to the last particles decaying and heat death of the universe before Node 1.0...


cool :+1:

@othiym23 othiym23 added error-messages and removed easy labels

It's entirely possible to fix this from the npm side of things, which is why the error-messages tag exists. It would be sweet to have node-level support for this, but yeah, entropy, heat-death of the universe, etc, and if 0.8's long tail is any indication, 0.10 is going to be with us for a while as well, even if 0.12 were to drop tomorrow.

@othiym23 othiym23 removed the nice to have label

See PR #6634 for a candidate fix.

@othiym23 othiym23 closed this issue from a commit
@smikes smikes include command in spawn errors (fixes #3908)
factor to centralize
wrap child, make it aware of filename
@othiym23 othiym23 closed this in e007a2c

Landed in e007a2c. May need a few further tweaks, as I'm not sure @smikes's solution catches all of the spawn failures, but it's a big step forward. Thanks!


Hi. There is a problem with this fix, namely
lines 11-12:
" var raw = _spawn(cmd, args, options)
cooked = new EventEmitter()"

Here is a missing comma. So "cooked" is global, which (at least in our build) leads to an npm crash without any messages. I could trace it down to this missing comma. This happens, whenever spawn is called again, before the first one could finish.

I hope this can be fixed soon.


Thanks for the timely and specific bug report! There is a candidate fix (#6752).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.