Framework7 CLI installations stops due to EACCESS error

When I am doing on a Mac: sudo npm install -g framework7-cli I receive the next error in terminal:

info sharp Using cached /Users/razbuchnik/.npm/_libvips/libvips-8.7.0-darwin-x64.tar.gz

ERR! sharp EACCES: permission denied, mkdir '/usr/local/lib/node_modules/framework7-cli/node_modules/sharp/vendor'

info sharp Attempting to build from source via node-gyp but this may fail due to the above error

info sharp Please see for required dependencies

gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/razbuchnik/.node-gyp/10.15.1"

gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/framework7-cli/node_modules/sharp/.node-gyp"

gyp WARN install got an error, rolling back install

gyp WARN install got an error, rolling back install

gyp ERR! configure error 

gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/framework7-cli/node_modules/sharp/.node-gyp'

gyp ERR! System Darwin 17.7.0

gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"

gyp ERR! cwd /usr/local/lib/node_modules/framework7-cli/node_modules/sharp

gyp ERR! node -v v10.15.1

gyp ERR! node-gyp -v v3.8.0

gyp ERR! not ok 


npm ERR! errno 1

npm ERR! [email protected] install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the [email protected] install script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/razbuchnik/.npm/_logs/2019-02-26T17_17_56_442Z-debug.log

Can someone please answer this? Am having same issues

I’ve tried running sudo npm clean cache --force yet it won’t work

Manually remove the ~/.npm folder and reinstall

You mean sudo rm -rf ~/.npm?

If this is what you mean, how would it affect every other package already existing?

I have re-downloaded the Node.js and then it worked.