-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
执行
gitbook-install报 spawn npm ENOENT 错误
原因:在windows下npm的执行命令不同1
将 gitbook-install/lib/util.js 文件中第53行代码修改如下
installPlugins() {
if(plugins === null) throw new Error('Error: no plugins');
if(args === null) throw new Error('Error: no npm arguments');
- cp.execFile('npm', args, (err, stdout) => {
+ cp.execFile(process.platform === 'win32' ? 'npm.cmd' : 'npm', args, (err, stdout) => {
if(err) {
throw(err);
} else {
log();
log(stdout);
process.exit();
}
});
return this;
},Footnotes
Metadata
Metadata
Assignees
Labels
No labels