Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

On Windows npm is using %AppData%\npm by default (which is wrong btw, it should use %LocalAppData%\npm as %AppData% is meant for configuration files).

This means I don't require any elevation to install packages for my user without additional configuration.

Installing tools like yarn or @angular/cli globally is not uncommon.



I have no idea about windoze. I disagreed with the above incorrect statement about Linux.


It wasn't incorrect, you misunderstood. npm just uses silly defaults on Linux while using saner defaults on Windows and mac os. I am a Linux user and having to configure npm to use another path for global packages that I use in literally all my projects is just bad UX.


Sure, npm has bad UX. (For an actual example, see the stubborn refusal to follow XDG spec.) This is not an example of that. Defaulting prefix to "/usr/local" is what every well-behaved Linux package does.

It seems odd to install so many packages at the "global" (but not owned by root!) level, that using the "--prefix=~" flag would be a hardship. I just checked; I have three. You can't fault npm for this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: