我在Gruntfile.js中使用grunt-exec v1.0.1的配置。
grunt.initConfig({
exec: {
tsc: {
cmd: "tsc"
}
},
...
}
...
grunt.loadNpmTasks('grunt-exec');
grunt.registerTask('debug', [
...
'exec:tsc',
...
]);然后在控制台grunt debug中正确地运行tsc。
在另一个配置类似的项目中,它安装了grunt-exec的最后一个版本(v.2.0.0)并运行grunt-debug,返回下一个错误:
Running "exec:tsc" (exec) task
>> Failed with: Error: spawn tsc ENOENT
Warning: Task "exec:tsc" failed. Use --force to continue.使用-verbose选项,它返回:
Running "exec:tsc" (exec) task
Verifying property exec.tsc exists in config...OK
File: [no files]
tsc
buffer : disabled
timeout : infinite
killSig : SIGTERM
shell : true
command : tsc
args : []
stdio : [ignore,pipe,pipe]
cwd : D:\Pruebas\Angular 2\ATemplate
exitcodes: 0
pid : undefined
>> Failed with: Error: spawn tsc ENOENT
Warning: Task "exec:tsc" failed. Use --force to continue.我知道我可以使用grunt-exec的v1.0.1让它工作,但我想知道如何使用v2.0.0来实现它。github中的项目文档没有给我提供任何线索。
发布于 2017-04-27 13:46:58
看起来,grunt-exec版本v2.0.0使用了一些在较早版本的节点中不支持的ECMAScript特性。
我第一次看到的是:
节点< v6.10.2不支持的Symbol.match, String.prototype.endsWith参见此处:http://node.green/
升级节点版本以解决此问题。
https://stackoverflow.com/questions/43656851
复制相似问题