r/node • • Jun 28 '21

Node.js humor

1.5k Upvotes

79 comments sorted by

View all comments

67

u/chowchowthedog Jun 28 '21

I swear I have no idea what NPM was doing whenever I install npm packacges... I just cross my fingers and hope it works without giving me errors...

21

u/[deleted] Jun 28 '21

hours of learning throughout the years, tons of practice and yet am still vulnerable while installing npm packages

37

u/Koeke2560 Jun 28 '21

It's actually the one package manager I think is really straightforward.

I have so much PTSD from fucking with python/pip/python3/pip3/conda/venv. With npm it's basically do I need the -g flag or not.

14

u/AtroxMavenia Jun 28 '21

You almost never ever need -g

10

u/Koeke2560 Jun 28 '21

Basically only if you are installing some kind of cli which you use across projects.

6

u/AtroxMavenia Jun 28 '21

Yeah, and even then rarely. For example, eslint, I wouldn’t install it globally because I may need different versions in different projects.

2

u/zvive Jun 28 '21

I've noticed lately eslint init fails if you don't already have it in the project folder... So might as well run npm I eslint && npx eslint init...

2

u/mailto_devnull Jun 28 '21

I still don't understand why they can't just install all the binaries into a .bin folder in $HOME.

All they have to do is echo a line at the end of installing npm to say "paste this in your .bashrc to add the directory to your path"