Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ember nw crashes before starting nw.js #4

Closed
AKST opened this issue Mar 12, 2015 · 4 comments · Fixed by #7
Closed

ember nw crashes before starting nw.js #4

AKST opened this issue Mar 12, 2015 · 4 comments · Fixed by #7
Labels

Comments

@AKST
Copy link

AKST commented Mar 12, 2015

Every time I run ember nw, it builds the nw app, but then it crashes just before starting nw.js. However I can run nw in the same project and the nw application will start. Here is the output from ember-cli

version: 0.1.5
Build successful - 7313ms.

Slowest Trees                  | Total
-------------------------------+----------------
CoffeeScriptFilter             | 2251ms
EsnextFilter                   | 1789ms
EsnextFilter                   | 468ms
ES6Modules                     | 411ms

Starting nw.js...
Error running nw.js
spawn ENOENT
Error: spawn ENOENT
  at errnoException (child_process.js:1011:11)
  at Process.ChildProcess._handle.onexit (child_process.js:802:34)
@AKST AKST changed the title vague crash on ember nw ember nw crashes before starting nw.js Mar 12, 2015
@AKST
Copy link
Author

AKST commented Mar 12, 2015

I'm running OS X, and I have installed node webkit via npm, this line maybe the culprit? I'm not sure it's reasonable to assume people on OS X have installed nw.js as a application, but at the very least it should be worth while to provide an error message indicating that they should set a environment variable to indicate the location of nw in the event of the child process crashing.

@brzpegasus
Copy link
Owner

Thanks for reporting this! I'll work on a fix to handle this more graciously and publish a new version soon. Hopefully, you're still able to get things running in the meantime with the NW_PATH setting.

@brzpegasus brzpegasus added the bug label Mar 12, 2015
@AKST
Copy link
Author

AKST commented Mar 12, 2015

No worries! Yeah I saw the NW_PATH when digging through the source.
On Thu, 12 Mar 2015 at 10:52 pm, Estelle DeBlois notifications@github.com
wrote:

Thanks for reporting this! I'll work on a fix to handle this more
graciously and publish a new version soon. Hopefully, you're still able to
get things running in the meantime with the NW_PATH setting.


Reply to this email directly or view it on GitHub
#4 (comment)
.

brzpegasus added a commit that referenced this issue Mar 15, 2015
* Update blueprint to add 'nw' as a local NPM dependency
* Update 'ember nw' command to look for local 'nw' package first, with fallback to binary specified by process.env.NW_PATH
* Improve error message

Closes #4
@brzpegasus
Copy link
Owner

I've updated the addon to add NW.js as a local NPM package in your project when you first install the addon with ember install:addon ember-cli-node-webkit.

ember nw will now look for the nw binary in the project's local dependencies first, then search for the NW_PATH environment variable next, and finally fallback to running plain vanilla nw. If none of those works, an error message on how to configure the NW.js binary is shown:

Starting nw.js...

Error running the following command: nw

Either re-run the blueprint with 'ember g node-webkit' to add NW.js as an NPM dependency in your project,
or set an environment variable named 'NW_PATH' pointing to your NW.js binary.

You can read more about the changes here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants