asdf - the multiple runtime version manager
Why asdf?
- Simple to install and maintain.
- Easy to switch runtime (e.g. nodejs) version, just cd into directory
- one tool for most common runtime needed for development
Installation
brew install asdf
for details refer to - getting started
Update path (for zsh shell)
echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc
for other shells refer to - getting started
Install plugin (nodejs)
asdf plugin add nodejs
other supported plugins
Install node latest version
asdf install nodejs latest
user version number instead of latest for any specific version
e.g. asdf install nodejs 20.12.0
To use any globally everywhere
asdf global nodejs latest
To use any folder specific local version
cd local_folder
asdf local nodejs 20.12.0
config file
- Global version versions config normally available under home folder (
~/.tool-versions
) - Local version will be under specific local folder same file name
.tool-versions
config file format
deno 1.44.4
nodejs 20.12.2
rust 1.79.0
yarn 1.22.22
pnpm 9.4.0
for another other details refer to documentation on asdf-vm.com
Note
Don't forget to run asdf reshim
after installing global packages (e.g. npm install -g <tool_name>
, cargo install <tool_name>
, etc)
HAPPY CODING π
Top comments (0)