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

Question: run node in shellscript #69

Open
pangrr opened this issue Dec 8, 2017 · 5 comments
Open

Question: run node in shellscript #69

pangrr opened this issue Dec 8, 2017 · 5 comments

Comments

@pangrr
Copy link

pangrr commented Dec 8, 2017

I recently got this error using nyc with child_process.execFileSync('bash', ['-c', 'node --version']) in windows7 with git bash:

/c/Users/xxx/.node-spawn-wrap-11344-5af67802646a/node: C:\Program: bad interpreter: No such file or directory

I feel this error is related to the README.md piece:

In order to handle cases where node is invoked in a shell script, the PATH environment variable is modified such that the the shim will be run before the "real" node. However, since Windows does not allow executing shebang scripts like regular programs, a node.cmd file is required.

I don't know how does it mean by a node.cmd file is required. Could you help?
Thanks in advance.

@felixfbecker
Copy link

I have the same problem, trying to run an integration test in Windows CI to test functionality that adds a git hook. Getting this error:

.git/hooks/prepare-commit-msg: /c/Users/appveyor/.node-spawn-wrap-672-3f5c8b42c435/node: C:\Program: bad interpreter: No such file or directory

Which looks like some path to node is not quoted correctly, hence the path breaks at the space in C:\Program Files\, which usually doesn't happen on mac/Linux because spaces are rarer in paths.

@felixfbecker
Copy link

Seems like #51 should fix this?

@pangrr
Copy link
Author

pangrr commented Dec 12, 2017

@felixfbecker I think it's a different issue. #51 is about the path to .node-spawn-wrap-*/node.cmd.
It seems that our issue is about the path in the shebang line of .node-spawn-wrap-*/node.

If you make a copy of .node-spawn-wrap-* and play with the shebang line in the node script inside your copy, you can observe the behavior.

@pangrr
Copy link
Author

pangrr commented Dec 12, 2017

#70

@gucong3000
Copy link

gucong3000 commented May 16, 2018

Is there anything I can do to help? I've been plagued by this bug for a long time.

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

Successfully merging a pull request may close this issue.

3 participants