Skip to content

Instantly share code, notes, and snippets.

@comoc
Last active April 13, 2016 10:12
Show Gist options
  • Select an option

  • Save comoc/ad40348b4a92cb84a0b47046dfb98934 to your computer and use it in GitHub Desktop.

Select an option

Save comoc/ad40348b4a92cb84a0b47046dfb98934 to your computer and use it in GitHub Desktop.
nodeのchild_processのexecが失敗する時の対策 ref: http://qiita.com/comocc/items/9a2236d32d257a840ef5
var exec = require('child_process').exec;
exec('foo bar', {cwd: 'C:¥somewhare'}, function(error, stdout, stderr) {
if (error != null) {
console.log(error);
}
});
cd c:¥somewhare
node app.js
Error: Command failed: C:\Windows\system32\cmd.exe /s /c "foo bar"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment