weird error `npm install -g`


(Andrey) #1

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

I don’t really get it. reinstalled nvm & node as in https://nodesource.com/blog/installing-node-js-tutorial-using-nvm-on-mac-os-x-and-ubuntu/, 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 https://github.com/creationix/nvm/issues/1533, 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


(Andrey) #2

npm -v
6.4.1
node -v
v10.12.0


(Andrey) #3

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


(system) #4

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.