Setup Asdf version manager

Asdf is a version manager for everything: Ruby, Elixir, Erlang, Node.js, and so on. It is the preferred version manager for projects that aren't using Docker.

Clone the repo

Install asdf via git into ~/.asdf.

git clone ~/.asdf

Add to bashrc

Add it to bashrc. (If you're on zsh, add it to ~/.zshrc. For fish shell and others, see asdf setup docs).

# bash / Ubuntu
echo '. $HOME/.asdf/' >> ~/.bashrc
echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
# bash / OSX
echo '. $HOME/.asdf/' >> ~/.bash_profile
echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bash_profile
# Zsh
echo '. $HOME/.asdf/' >> ~/.zshrc
echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc

Install dirmngr

For Ubuntu and other Debian-based distributions, install dirmngr. This is required to add NodeJS GPG keys.

  sudo apt-get install dirmngr

Add plugins

Add asdf-vm plugins for Erlang, Elixir and Node.js, and anything else you may need.

asdf plugin-add erlang
asdf plugin-add elixir
asdf plugin-add nodejs
bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring