【发布时间】:2016-10-02 06:04:29
【问题描述】:
在 WebStorm 上执行 nodejs 脚本作为构建配置失败,并出现以下错误:
Warning: spawn cmd.exe ENOENT Use --force to continue.
Aborted due to warnings.
从终端运行相同的脚本可以正常工作。失败的部分是运行 grunt 任务(shell 命令):
function buildInserter(cb) {
var defer = Q.defer();
grunt.tasks([ 'shell:release-inserter' ], { gruntfile: './gruntfile.js' }, function () {
defer.resolve();
if( typeof cb === 'function' ) {
cb();
}
});
return defer.promise;
}
我尝试了this answer 中描述的方法,但没有帮助。
【问题讨论】:
-
我猜 cmd.exe 或节点二进制文件不在环境路径中。
-
C:\Windows\system32 丢失。谢谢你。我可以请你添加这个作为答案吗?