npm will not install express?
I had the same problem, and npm cache clear
did not fix it. This problem is caused because the .npm
directory in your home directory was created with root privileges. Most likely the first npm command you ran was sudo npm -g
and now you are trying to npm install
in a local directory.
To solve:
sudo chown -R yourusername ~/.npm
- This may not be necessary but I also had to
rmdir ~/tmp
npm install
from package.json should work after this.
run npm cache clean
and try to install it again