Select Nodejs version by using nvm on Ubuntu

·

1 min read

curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
  source ~/.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
  nvm install node
  nvm install 16
  nvm use 16
  npm i -g yarn