0

When I install sudo npm i sharp -g

/usr/lib/node_modules/sharp/binding.js:3
const fs = require('fs');
^^^^^ 

SyntaxError: Use of const in strict mode.

When I try install some packages with ES6 syntax

After upadate nodejs and npm my versions is

node -v  -----> v6.9.4
npm -v   -----> 4.1.2
node-gyp -v ----> v3.4.0 

I tried to use this command

sudo npm cache clean -f

But it does not work...

coder fire
  • 993
  • 2
  • 11
  • 24
  • Possible duplicate of [SyntaxError: Use of const in strict mode](http://stackoverflow.com/questions/22603078/syntaxerror-use-of-const-in-strict-mode) – Iurii Drozdov Jan 19 '17 at 13:17

1 Answers1

0

I uninstalled Node and reinstalled from the official site. It appears I had an old version of node in there causing issues. Installs worked just fine after that.

https://nodejs.org/en/download/

Auri Rahimzadeh
  • 2,133
  • 15
  • 21