istanbuljs / istanbuljs/spawn-wrap

Question: run node in shellscript

Open
#69 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
41
Forks
18
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.