Grunt 插件 grunt-exec v2.0.0 不执行简单的命令,而 v1.0.1 执行



i使用grunt-exec v1.0.1,在 Gruntfile.js中使用此配置:

grunt.initConfig({
    exec: {
        tsc: {
            cmd: "tsc"
        }
    },
    ...
}
...
grunt.loadNpmTasks('grunt-exec');
grunt.registerTask('debug', [
    ...
    'exec:tsc',
    ...
]);

然后在控制台tsc中正确执行grunt debug

在另一个具有类似配置的项目中,它安装了最后版本 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:PruebasAngular 2ATemplate
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的项目文档没有给我一个线索。

看起来grunt-exec版本v2.0.0使用了一些ecmascript功能,这些功能在旧版本的节点中不支持。

我看到的第一个是:

Symbol.match, String.prototype.endsWith node&lt中不支持;v6.10.2请参阅此处:http://node.green/

升级您的节点版本以解决此问题。

最新更新