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

nodal s error on windows 7 #22

Closed
devmetal opened this issue Jan 6, 2016 · 14 comments
Closed

nodal s error on windows 7 #22

devmetal opened this issue Jan 6, 2016 · 14 comments

Comments

@devmetal
Copy link

devmetal commented Jan 6, 2016

Hi, i followed the getting started guide and when i try execute nodal s command i get this exception:

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

Error: spawn npm ENOENT
    at exports._errnoException (util.js:856:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at doNTCallback2 (node.js:452:9)
    at process._tickCallback (node.js:366:17)
    at Function.Module.runMain (module.js:459:11)
    at startup (node.js:138:18)
    at node.js:974:3

Pls tell me what i doing wrong.

@ducher
Copy link

ducher commented Jan 6, 2016

Same here on windows 8.1, I also get this error when I execute nodal new:

Copying Nodal directory structure and files...

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

Error: spawn npm ENOENT
    at exports._errnoException (util.js:870:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at doNTCallback2 (node.js:441:9)
    at process._tickCallback (node.js:355:17)

I tried both executing it as admin or not, and with nodal installed as admin or not.

@keithwhor
Copy link
Owner

Hey,

Don't get the opportunity to do bugfixing on Windows much. I'll look into it on a VM as soon as I can, hold tight. This is a priority for me to fix.

@IrregularShed
Copy link
Contributor

I'm getting the same here. The error isn't occurring in Nodal itself, but in spawning npm, and I'm getting it for nodal s as well as nodal new. Looking at these sections of cli/cli.js there's reference to stdio which is probably where the issue lies - that's a pretty Unix-y thing to be trying to use on a Windows command line.

I've got 20 minutes to spare, so I'll see if I can identify a fix.

@IrregularShed
Copy link
Contributor

It looks as if child_process.spawn is the source of the problem, as it can only execute executables, which sounds obvious on the face of it but shows a difference between Unix and Windows - you can't make a script an executable by toggling a bit and adding #! to the top of it in Windows.

This is directly relevant: nodejs/node-v0.x-archive#5841

The options (as I can see them):

  • Find a way to get spawn to behave on Windows. This would probably involve launching batch files to run the scripts.
  • Find an existing alternative to spawn that's Windows compatible in npm. There will be something out there, but we'd need to consider maturity.
  • Use child_process.exec instead, which apparently doesn't have this issue (see above link). I've never tried using it so I don't know what the trade-offs are.
  • Put the problematic parts in try{ .. } catch() { .. } blocks so that exec can be used if spawn fails. I'd only consider that a stop-gap though!

@IrregularShed
Copy link
Contributor

I've got a fix from experimentation, and will raise a PR shortly :)

@IrregularShed
Copy link
Contributor

PR: #53

@ducher
Copy link

ducher commented Jan 8, 2016

Awesome! Thanks for taking some of your time to do that :)

@bugthesystem
Copy link

+1

@keithwhor
Copy link
Owner

👍 Will merge in the PR after a test or two goes with it. :)

@ducher
Copy link

ducher commented Jan 11, 2016

Fixed for me :) Thanks a lot to IrregularShed, schahriar and keithwhor of course!

@keithwhor
Copy link
Owner

No problem! Glad we could help.

@aruncourage
Copy link

Error: watch app EACCES
[1] at exports._errnoException (util.js:870:11)
[1] at FSWatcher.start (fs.js:1234:19)
[1] at Object.fs.watch (fs.js:1262:11)
[1] at createFsWatchInstance (/var/www/html/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:37:15)
[1] at setFsWatchListener (/var/www/html/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:80:15)
[1] at FSWatcher.NodeFsHandler._watchWithNodeFs (/var/www/html/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:228:14)
[1] at FSWatcher.NodeFsHandler._handleDir (/var/www/html/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:407:19)
[1] at FSWatcher. (/var/www/html/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:455:19)
[1] at FSWatcher. (/var/www/html/angular2-quickstart/node_modules/chokidar/lib/nodefs-handler.js:460:16)
[1] at FSReqWrap.oncomplete (fs.js:82:15)
[1]
Could you please help me anyone

@HBReview
Copy link

HBReview commented May 31, 2016

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

Error: spawn cmd ENOENT
at exports._errnoException (util.js:870:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17)

i got this error after running gulp serve command,could please help me

@keithwhor
Copy link
Owner

Why are you trying to run gulp serve with Nodal? What's the use case?

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

No branches or pull requests

7 participants