Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

child_process 执行命令 git commit -m "test"报错,请大大指教,感谢

$
0
0

var path = require(‘path’); var child = require(‘child_process’); var exec = child.exec; //提交暂存区的指定文件到仓库区 child.exec(’/usr/bin/git commit -m “11111”’, {cwd: ‘/Users/wangchengjun/www/yooli/femock’}, function(error, stdout, stderr){ if(error){ throw error; } console.log(stdout); });

Error: Command failed: /usr/bin/git commit -m “11111”

at ChildProcess.exithandler (child_process.js:206:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

Viewing all articles
Browse latest Browse all 14821

Trending Articles