Question: I'm trying to help someone fix the npm command not found error on a mac, We read it could be a permissions problem.For permissions issues,
I'm trying to help someone fix the "npm command not found" error on a mac, We read it could be a permissions problem.For permissions issues, you usually prefix your terminal commands with sudo to bypass issues but we saw some people online suggest the following:
sudo chown -R $(whoami):admin /usr/local/lib/node_modules/
this command is supposed to adjust the permissions of the npm directory . I need help deciphering if this command changes the owner from you ( whoami) to your PC admin group?? If that's true then how would that help in npm-related issues due to permissions?
I think I follow the rest: Basically chown means change owner, -R means recursively (throughout the files therein), whoami grabs your user account name, and the last line is where your node package files are. I just dont get why changing owner from user to admin helps, and if admin is called admin in all macs??
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
