2

I installed node JS in linux virtual machine on my windows. The problem is I can't use npm like npm install -g node-inspector. But I think the error is because of my node version. My node JS version is 0.10.35. I tried below one. but it still doesn't work. The error message gyp WARN EACCES user "root" does not have permission to access the dev dir "~/.node-gyp/0.10.35"

sudo npm cache clean -f
sudo npm install -g n
sudo n stable
  • Can you be more specific about the error you are getting? (posting the actual error message you are getting would probably be good) – therealrootuser Dec 25 '14 at 23:18
  • The error message gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/tulga/.node-gyp/0.10.35" – Tulga Narmandakh Dec 25 '14 at 23:19
  • Possible duplicate of [gyp WARN EACCES user "root" does not have permission to access the dev dir](http://stackoverflow.com/questions/29468404/gyp-warn-eacces-user-root-does-not-have-permission-to-access-the-dev-dir) – psiphi75 Apr 24 '16 at 18:48

1 Answers1

0

You installed node v0.10.35 in a Linux virtual machine. Assuming that node still works, here's how you can fix your npm.

curl https://www.npmjs.org/install.sh | sudo sh

This should get you a working npm.

However, the error you report sounds more like a problem with node-gyp and building native addons. If you are getting an error while running npm, please upload the npm-debug.log to https://gist.github.com and post a link to the gist in the npm issue tracker at https://github.com/npm/npm/issues.

Thanks!

Sam Mikes
  • 10,438
  • 3
  • 42
  • 47