You are not logged in.

#1 2023-04-30 19:02:55

morris_tai
Member
Registered: 2023-04-30
Posts: 1

Why install npm/nodejs via pacman result in /usr/lib/node_modules

Hi all, I'm new here. (Sorry if this is a dumb question.)
But I recently found out that if I install node/npm in Arch via pacman/yay, it will default install node_modules in /usr/lib/node_modules. Shouldn't it install inside /usr/local/lib/node_modules?
Now every time I install something via npm, I need to be root. Does anyone know how to fix it? Thanks for any replies.

Offline

#2 2023-04-30 19:41:25

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: Why install npm/nodejs via pacman result in /usr/lib/node_modules

Packages don't go to /usr/local/. Ever. Even there, you would still need root.

Offline

#3 2023-04-30 19:42:31

yochananmarqos
Member
Registered: 2020-02-05
Posts: 196

Re: Why install npm/nodejs via pacman result in /usr/lib/node_modules

See https://wiki.archlinux.org/title/Arch_p … irectories

You should never install anything with NPM, Pip, etc. as root. For development, you should be using a virtual environment.

Last edited by yochananmarqos (2023-04-30 19:44:02)

Online

Board footer

Powered by FluxBB