-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
child_processIssues and PRs related to the child_process subsystem.Issues and PRs related to the child_process subsystem.invalidIssues and PRs that are invalid.Issues and PRs that are invalid.
Description
child_process.spawn
does not work with npm run scripts
on windows.
# package.json
{
"dependencies": {
"touch": "^1.0.0"
},
"scripts": {
"test": "npm run touch1 --verbose && node test.js",
"touch1": "touch foo.txt"
}
}
# test.js
var spawn = require('child_process').spawn;
var touch1 = spawn('npm', ['run', 'touch1', '--verbose'], { stdio: 'inherit' });
touch1.on('error', function(err) {
console.error(err);
process.exit(1);
});
npm run touch1
works fine both linux and windows.
spawn('npm', ['run', 'touch1'])
works fine on linux.
https://travis-ci.org/sanemat/node-windows-spawn-confirm/builds/89416274
But this does not work on windows.
https://ci.appveyor.com/project/sanemat/node-windows-spawn-confirm/build/1.0.2
{ [Error: spawn npm ENOENT]
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'spawn npm',
path: 'npm' }
Is this nodejs issue? or npm issue?
confirming code: child_process.spawn does not work with npm run scripts on windows. by sanemat · Pull Request #2 · sanemat/node-windows-spawn-confirm
meszaros-lajos-gyorgy, TheMagnificent11, bomzj, richrdkng, Maxim-Mazurok and 9 more
Metadata
Metadata
Assignees
Labels
child_processIssues and PRs related to the child_process subsystem.Issues and PRs related to the child_process subsystem.invalidIssues and PRs that are invalid.Issues and PRs that are invalid.