I followed the steps on Node.js website and node got installed properly . While I tried using the npm to install package i ran into issues which where after several attempts couldnt be resolved … tried every solution… and I almost installed node 10 times with every new solution … (removed the older ones ) … .
Digital ocean described NVM ways … and many other websites with step by step tutorials to install nodejs and npm to resolve 1issues on ubuntu 14.04
Linuxbrew was the last try I did and it worked thats all …
To take ownership of permission issues:
sudo chown -R $(whoami) ~/.npm
and if problem still persists, I assume it’s related to building source with node-gyp, we can try remove node and npm; remove node_modules folder as well and reinstall node and npm and so on with packages. This should works.