Installing nvm on Fedora

Wanted to install node.js on my dev box. Went the nvm (Node Version Manager) route and followed the instructions for a scripted install there. Only needed to make one change. Reveal below.

This was tested on Fedora 19.

Used this suggested one-liner to download and run the install script with curl:

curl https://raw.githubusercontent.com/creationix/nvm/v0.7.0/install.sh | sh

The current nvm install script appends this line to the user’s bash_profile:

[ -s "/home/myuser/.nvm/nvm.sh" ] && . "/home/myuser/.nvm/nvm.sh" # This loads nvm

That didn’t do anything for me, so I moved it to the bottom of .bashrc, and voila! It worked.

That’s pretty much as expected, as generally .bashrc is where you want to put executable code, while .bash_profile is for stuff like defining environment variables (I understand this is also how things work in Ubuntu, so I’m not sure where the nvm developer’s tested this).

Now I get nvm’s help when I type in “nvm”. Installing node was then as simple as:

[myuser@test1 ~]$ nvm install 0.10
######################################################################## 100.0%
Now using node v0.10.28

To set my default version of node to 0.10 I only had to issue the command:

nvm alias default 0.10

This should result in later console sessions showing:

[myuser@test1 ~]$ node --version
v0.10.28
This entry was posted in Development, System Administration on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).