jslicense / licensee.js

check dependency licenses against rules
https://www.npmjs.com/package/licensee
Apache License 2.0
185 stars 23 forks source link

Catch error event from spawned npm process #49

Closed plampila closed 5 years ago

plampila commented 5 years ago

Avoids node terminating with an unhandled 'error' event.

kemitchell commented 5 years ago

@plampila: Thanks!

Do you license your contribution under Apache 2.0?

Do you mind me asking what kinds of uncaught errors you were seeing? Related to #50?

plampila commented 5 years ago

Yes. I license my contribution under Apache 2.0

And yeah, npm executable not being found was causing an error event:

> licensee --production --errors-only

events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: spawn npm ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
    at onErrorNT (internal/child_process.js:407:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
    at onErrorNT (internal/child_process.js:407:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)