Last active
April 13, 2016 10:12
-
-
Save comoc/ad40348b4a92cb84a0b47046dfb98934 to your computer and use it in GitHub Desktop.
nodeのchild_processのexecが失敗する時の対策 ref: http://qiita.com/comocc/items/9a2236d32d257a840ef5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var exec = require('child_process').exec; | |
| exec('foo bar', {cwd: 'C:¥somewhare'}, function(error, stdout, stderr) { | |
| if (error != null) { | |
| console.log(error); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd c:¥somewhare | |
| node app.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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