2

I was using grunt-exec v1.0.1 with this configuration in Gruntfile.js:

grunt.initConfig({
    exec: {
        tsc: {
            cmd: "tsc"
        }
    },
    ...
}

...

grunt.loadNpmTasks('grunt-exec');

grunt.registerTask('debug', [
    ...
    'exec:tsc',
    ...
]);

Then running grunt debug in console tsc is executed correctly.

In another project with similar configuration it's installed the last version of grunt-exec(v.2.0.0) and running grunt-debug the next error is returned:

Running "exec:tsc" (exec) task
>> Failed with: Error: spawn tsc ENOENT
Warning: Task "exec:tsc" failed. Use --force to continue.

With -verbose option it returns:

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.

I know I can have it working using v1.0.1 of grunt-exec but I want to know how must I do it with v2.0.0. The project documentation in github has not given me a clue.

francadaval
  • 2,451
  • 3
  • 26
  • 36

1 Answers1

2

Looks like the grunt-exec version v2.0.0 uses some ECMAScript features that are not supported in older versions of node.

The first one i saw was:

Symbol.match, String.prototype.endsWith that is not supported in node < v6.10.2 See here: http://node.green/

Upgrade your node version to fix this issue.

Revive
  • 2,248
  • 1
  • 16
  • 23