Created
December 13, 2016 16:50
-
-
Save DorkNstein/aed036123c9dca0030ee00c9e9264e57 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum update -y | |
sudo yum install -y git gcc-c++ openssl-devel make | |
git clone git://github.com/creationix/nvm.git ~/.nvm | |
printf "\n\n# NVM\nif [ -s ~/.nvm/nvm.sh ]; then\n\tNVM_DIR=~/.nvm\n\tsource ~/.nvm/nvm.sh\nfi" >> ~/.bashrc | |
NVM_DIR=~/.nvm | |
source ~/.nvm/nvm.sh | |
nvm ls-remote | |
nvm install vx.x.x (v4.7.0) | |
nvm alias default vx.x.x | |
node -v ## => vx.x.x | |
npm -v ## => v2.x.x | |
sudo node -v # if it says node: command not found | |
sudo ln -s ~/.nvm/versions/node/vx.x.x/bin/node /bin/node # ~/.nvm/versions/node/vx.x.x/bin/node is the path found from 'which node' | |
sudo ln -s ~/.nvm/versions/node/vx.x.x/bin/npm /bin/npm # ~/.nvm/versions/node/vx.x.x/bin/npm is the path from 'which npm' | |
# if they through 'ln: failed to create symbolic link ‘/bin/node’: File exists' error | |
sudo rm -rf /bin/node | |
sudo rm -rf /bin/npm | |
sudo ln -s ~/.nvm/versions/node/vx.x.x/bin/node /bin/node # ~/.nvm/versions/node/vx.x.x/bin/node is the path found from 'which node' | |
sudo ln -s ~/.nvm/versions/node/vx.x.x/bin/npm /bin/npm # ~/.nvm/versions/node/vx.x.x/bin/npm is the path from 'which npm' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment