I am trying to avoid installing common Node packages redundantly for each user. I would like to install certain common Node packages globally. However, on Arch Linux, I encounter permissions issues.
npm install [package] -g fails with message:
Missing write access to /usr/lib/node_modules
This succeeds:
sudo npm install [package] -g However, then we get errors like this when a regular user tries to use the package:
Error: EACCES: permission denied, open '/usr/lib/node_modules/[package]/lib/[file].js'
What is the right way to do this, assuming we are required to install some packages globally. EDIT: see the reason for the requirements here.