npm/npm — pull request #6039 by isaacs (2014-08-26 19:02:30+00:00)
Title: ensure lifecycle spawn errors caught properly

Possibly related to #5987 #6029

Not sure if this is a new thing in a Windows 8 system update, or a new
Node bug, but the contract whereby ENOENT spawn errors trigger a
simulated failure-exit in Node (and thus `exit` and `close` events)
seems to have changed recently.

Handle this by catching error events that are fired on the child
process, so that at least we can print out the script and package that
we were TRYING to execute, and debug it at all.

Note: We should also back port to 1.4