NPM Error: gyp ERR! stack Error: EACCES: permission denied

npm install [Tried using root]
sudo npm install [Tried using ubuntu]

Error

Solutions

First Solution 1

$ sudo npm i –unsafe-perm

Last Solution 2
$ sudo rm -rf ~/.node-gyp
$ sudo npm cache clean -f
$ sudo npm install -g n
$ sudo n stable
$ sudo npm i -unsafe-perm

Rajesh Kumar
Total Page Visits: 321 - Today Page Visits: 27