I run npm install lodash but it throws Error: EACCES: permission denied error. I know it is permission issue but as far as I know, sudo permission
I solved this issue by changing the permission of my npm directory. I went to the npm global directory for me it was at
/home/
I went to this directory by entering this command
cd /home/
and then changed the permission of .npm folder by entering this command.
sudo chmod -R 777 ".npm"
It worked like a charm to me. But there is a security flaw with this i.e your global packages directory is accessible to all the levels.