Skip to content

Commands with spaces fail with shell: true #77

Closed
@imgx64

Description

@imgx64

Commands with spaces fail with shell: true, but work if it's false. node developers say fixing this from their side would break other things: nodejs/node#7367 . Should this be fixed in cross-spawn? What do you think?

> require('cross-spawn').spawn('C:\\Program Files\\nodejs\\node.exe', [], {shell:true})
undefined
> Error: spawn C:\Program Files\nodejs\node.exe ENOENT
    at notFoundError (C:\Users\redacted\node_modules\cross-spawn\lib\enoent.js:11:11)
    at verifyENOENT (C:\Users\redacted\node_modules\cross-spawn\lib\enoent.js:46:16)
    at ChildProcess.cp.emit (C:\Users\redacted\node_modules\cross-spawn\lib\enoent.js:33:19)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
> require('cross-spawn').spawn('C:\\Program Files\\nodejs\\node.exe', [], {shell:false})
ChildProcess {
...

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