nwjs/npm-installer

`npm start` should not wait for nw.js to finish

Mithgol opened this issue · 6 comments

Currently npm start seems to wait until nw.js finishes.

It probably should run nw.js as a non-modal child window (as if it were start "" nw on Windows or nw & on other systems) and finish immediately.

As a workaround it is possible to replace "start": "nw" in package.json with "start": "start \"\" nw" on Windows and "start": "nw &" on other systems, but such package.json is no longer cross-platform.

You can var nwpath = require('nw') and then spawn the binary detached: https://iojs.org/api/child_process.html#child_process_options_detached or any other preferred way.

Good idea, thanks.

(However, consider changing the current default behaviour as well.)

I really like the current behaviour (block until exit)! Maybe this could be implemented as a flag?

Happy to accept a patch for a flag, thanks!

Fixed in bb5872b by providing an example of spawning a detached process.

(I decided to refrain from changing the current behaviour of npm start because it apparently has its fans.)