NPM : Error : SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode


Note for my self but hope it helps someone also :)

If you found this error ..

$ npm
/usr/local/lib/node_modules/npm/bin/npm-cli.js:82
let notifier = require('update-notifier')({pkg})
^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:136:18)
at node.js:963:3

If you google “SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode” , you will find many solutions.

For me , the easiest Solution : Update my node version by manually download from node.js website .

Somepeople suggest to use sudo + npm such as here . 
Then somepeople might have a question Should we use sudo with npm? 
There are many articles to answer this. EX : here.