npm Error: EACCES: permission denied, access ‘/usr/lib/node_modules’

You try to install a package with npm globally and you get this? npm install –global …

npm ERR! Linux 4.14.78-desktop-1.mga6
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "--global" "web-ext"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
npm ERR! path /usr/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

Cause: Your user does not have write permission to the folder ‘/usr/lib/node_modules’.

Clean Solution: Relocate the the folder where npm stores globally installed packages to some folder in your home directory:

mkdir ~/.nodejs_global
npm config set prefix ~/.nodejs_global

And now you can run npm install -g … =)