2

I am new to grunt and after installing grunt-cli, wanted to try a simple command "grunt --help" and getting following error,

C:\Users\USER01>grunt --help

C:\Users\USER01\AppData\Roaming\npm\node_modules\grunt-cli\node_modules\liftup\node_modules\findup-sync\node_modules\micromatch\index.js:3
const util = require('util');
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (C:\Users\USER01\AppData\Roaming\npm\node_modules\grunt-cli\node_modules\liftup\node_modules\findup-sync\index.js:12:10)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

Additional Info :
C:\Users\USER01>npm --version
1.4.9

C:\Users\USER01>node --version
v0.10.28

Any clues would be appreciated.

Thanks, SK

  • Does this answer your question? [SyntaxError: Use of const in strict mode](https://stackoverflow.com/questions/22603078/syntaxerror-use-of-const-in-strict-mode) – RobC Aug 01 '21 at 12:55
  • 1
    Essentially (as per [this answer](https://stackoverflow.com/questions/22603078/syntaxerror-use-of-const-in-strict-mode#answer-23151062)) you need to update your Node.js to version 4.x or newer and the error should disappear. – RobC Aug 01 '21 at 13:01
  • 1
    Yup @RobC. updating nodejs worked for me. – saiyan Nov 01 '21 at 09:15

0 Answers0