0

I'm using ubuntu12 on vmware without admin account. everytime I install some package such as yeoman, grunt, bower, I need to after-work or before-work for permision issue.

here is my favorite way to fix them link.

everything seems to work well BUT I tried to update nodejs though npm

> sudo npm cache clean -f //work
> sudo npm install -g n   //looks install is completed
/home/kim/npm/bin/n -> /home/kim/npm/lib/node_modules/n/bin/n
n@2.0.1 /home/kim/npm/lib/node_modules/n
> sudo n stable
sudo : n: command not found
//I tried this too
> n
mkdir : cannot create directory `/usr/local/n' : Permission denied

looks same problem with what i went through BUT not works with my way. I want to fix these problems basically.


similar problem is here

> yo doctor
...
Your npm version is outdated
Upgrade to the latest version by running:
npm install -g npm
....
//i try to install npm as yo-doctor mentioned and looks done well
> npm install -g npm
/home/kim/npm/bin/npm -> /home/kim/npm/lib/node_modules/npm/bin/npm-cli.js
npm@2.13.4 /home/kim/npm/lib/node_modules/npm

//but when i re-check yo-doctor, same issues pop up again. WHY?
> yo doctor
...
Your npm version is outdated
Upgrade to the latest version by running:
npm install -g npm
....
Community
  • 1
  • 1
DK2
  • 651
  • 1
  • 7
  • 34

1 Answers1

1

I would suggest to start using https://github.com/creationix/nvm, the main problem is that Node installation doesn't belong to your user and trying to install global packages will require sudo, using nvm Node installation will belong to your user and you will get rid of all those permission problems.. as a plus you will be able to handle multiple versions of Node/io.js and keep it update will be really easy

edsadr
  • 1,087
  • 6
  • 17
  • so sould i use this package before installing nodejs, yeoman and bower? – DK2 Aug 13 '15 at 14:08
  • 1
    You just use node with nvm, this will replace your current Node installation, here is a nice tutorial from Digital Ocean: https://www.digitalocean.com/community/tutorials/how-to-install-node-js-with-nvm-node-version-manager-on-a-vps – edsadr Aug 13 '15 at 14:35
  • I cannot try this right now but I will soon. it might works for me :) – DK2 Aug 13 '15 at 15:40