Skip to content

Instantly share code, notes, and snippets.

@leolanese
Created November 16, 2018 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leolanese/96f6fa9c2987539565d48a9a8e5981d0 to your computer and use it in GitHub Desktop.
Save leolanese/96f6fa9c2987539565d48a9a8e5981d0 to your computer and use it in GitHub Desktop.
downgrade NODE using NVM (installing NVM)
NVM
node -v
npm install -g nvm
export PATH=./node_modules/.bin:$PATH
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
npm config delete prefix
nvm install v8.10.0
node -v
@leolanese
Copy link
Author

To verify that nvm has been installed, do:

command -v nvm

which should output 'nvm' if the installation was successful.
Please note that which nvm will not work, since nvm is a sourced shell function, not an executable binary.

Finally add this to your ~/profile:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion

@leolanese
Copy link
Author

finally set it up as default:

nvm alias default system

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment