20140527 installing nvm on fedora - plembo/onemoretech GitHub Wiki

title: Installing nvm on Fedora link: https://onemoretech.wordpress.com/2014/05/27/installing-nvm-on-fedora/ author: phil2nc description: post_id: 7709 created: 2014/05/27 14:35:41 created_gmt: 2014/05/27 18:35:41 comment_status: closed post_name: installing-nvm-on-fedora status: publish post_type: post

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

Copyright 2004-2019 Phil Lembo