osx-webdev-setup icon indicating copy to clipboard operation
osx-webdev-setup copied to clipboard

Sudo usage for npm

Open reklis opened this issue 9 years ago • 3 comments

You are heading in the right direction but I fear you are not seeing the whole picture.

"Don't use sudo" does not combine with "use the fuck" because the fuck uses sudo. So really, you shouldn't be using either.

The proper way to fix permissions problems with npm is to create an ~/.npmrc with a prefix to $home

https://docs.npmjs.com/files/npmrc

reklis avatar Jun 16 '15 11:06 reklis

? thefuck does not require sudo. i have never used it with sudo before.

jonathanong avatar Jun 16 '15 19:06 jonathanong

it's true it fixes many more things than just adding sudo to things, but it does add sudo to things. it's the very first entry in the readme and it's also all over the code

https://github.com/nvbn/thefuck/search?utf8=%E2%9C%93&q=sudo&type=Code

however, that really wasn't my point. I was trying to point out that if you configured your npmrc with a prefix to your home directory, you would not need to sudo npm install anything because your user would always have permission to their home directory

reklis avatar Jun 16 '15 19:06 reklis

you wouldn't have to use the npmrc file if you use nvm to use node and npm as it does its own pathing. i guess its two ways to do the same thing

jonathanong avatar Jun 16 '15 19:06 jonathanong