====== install yarn & latest node.js on linux ====== run all these steps as root to install nvm and node globally for all users. if you want to install node on a per-user basis, this guide is not for you, you need to modify the steps. remove any nodejs versions installed via the packet manager of your os .. for example linux: apt remove --purge nodejs install the latest version of nvm. note, this will install nvm globally for all users. export XDG_CONFIG_HOME="/opt" curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$(curl -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | grep "tag_name" | cut -d : -f 2,3 | tr -d ' ",')/install.sh | bash echo 'export NVM_DIR="'$XDG_CONFIG_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' > /etc/profile.d/nvm.sh source /etc/profile.d/nvm.sh install latest version of nodejs with nvm nvm install node add yarn repo (ubuntu, see [[https://classic.yarnpkg.com/en/docs/install|yarn docs]] for other distros) apt install curl gnupg2 # in case you are on a fresh and minimalistic installation, i.e. in a Dockerfile :) curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list install yarn without installing node.js from the repo.. apt update && apt install --no-install-recommends yarn