Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Ehh, isn't there some kind of user-level install? Using sudo sounds like a bad idea for installing packages, at least in python
-
hitko31465y@alexbrooklyn Not if you're installing it globally. Which begs the question, who still installs these things globally if you can (and SHOULD) put it as a devDepenedency and just run npx nodemon / yarn nodemon?
-
@hitko
-g dumps to /usr/local/lib/node_modules, so it shouldn't need sudo. I would suspect if it needs sudo, it's because it's building something. -
@SortOfTested Since when directories in /usr/local are writable by anyone except root?
-
@sbiewald
Seems like full rwxrwx+a on all the arch and fedora installs I have. Maybe someone has gremlin'd my machines? 😮 -
hitko31465y@SortOfTested It varies by the system & install method, debian-based systems + NodeSource put it in /usr/lib/node_modules, and last time I checked that folder was 755 root:root.
Just to add to my previous comment, it is possible to install "global" node modules in your home directory by setting a bunch of env variables, but it doesn't always work.
Related Rants
How often does this happen to you?
Hmm I need to install the nodemon package, ok so I enter:
npm install -g nodemon
Result:
npm WARN
npm WARN
npm ERR
npm ERR
npm ERR....
I then wonder why would it not work??? Then after looking at the errors I realise ohh:
sudo npm install -g nodemon
This literally happens to me almost every single time I install a package.
rant
root
sudo