npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

weird error `npm install -g`

gonna copy-paste IRC part of the “conversation”:

I don’t really get it. reinstalled nvm & node as in, all operations done from /opt directory. now doing which npm or which node inside this dir finds executables, but ANYWHERE ELSE, like root dir or subdir, they simply arent found anylonger at all
not to mention, I still can not run npm with a non-root user
made a group for nvm, as in, added root and my user(jenkins) to it
chown :nvm & chmod g+ws on everything recursively inside /opt
debian 8.8, added absolute …/bin pathes to $PATH for both node and npm to /etc/profile, loaded for both users
now getting stack Error: EACCES: permission denied
trying to: npm install -g @angular/cli@1.7.4
permission denied, mkdir ‘/LONGBORINGPATH/.nvm/versions/node/v10.12.0/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp’
then I try to do it manually from the same user, creating last 2 subdirs with mkdir -p, it works just fine
then I run the above npm install again. it, apparently, removes theses directories in the process… and tries to remkdir them and also fails. wtf
npm root & npm root -g point to the same directory
npm config get prefix also points there - …/lib/node_modules

npm -v
node -v

solved. how? no idea. reinstalled node in 5 different ways. last approach “worked”, yet still had issues with global install attempts, but just gave up on this for now