Skip to content

Question: run node in shellscript #69

@pangrr

Description

@pangrr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions