

This is the file I check in in my repositories ( example) to share the used versions of a project with other contributors. asdf local writes the version to $PWD/.tool-versions. asdf shell only to the current shell, which can be different compared to other shells. asdf global Īsdf global will write the selected version to $HOME/.tool-versions ( docs). Once you installed the plugin nodejs with the required version you can choose to either set and use this version globally, in your current shell, or in the current project folder. # asdf install nodejs 14.15.4 # list installed versions Again, this can be done with a few simple commands. Now that we have Node.js installed, let's see how we can install one or more versions. # asdf plugin add nodejs # get a list of installed plugins Let's see how this looks like for Node.js. Therefore, you must first install the necessary plugin and then the versions. One thing you need to know about asdf is that each supported language requires a plugin which in turn manages the versions of the language. Once you have installed the commands you should see which version you have installed when executing asdf -version. $(brew -prefix asdf)/etc/bash_completion.d/asdf.bash" > ~/.bash_profile

$(brew -prefix asdf)/asdf.sh" > ~/.bash_profile Execute the following commands in this order to install and set up asdf: # install required dependencies For this tutorial, I have chosen macOS and Homebrew. On their website, select your operating system and installation method. With a few commands (FTR: I only talk about macOS in this article) you have asdf installed and ready to go. You may think that a handstand is necessary to use asdf as the primary version manager, but I can assure you that is not necessary. asdf has become my favorite and has replaced all other version managers because asdf supports multiple languages at once (Ruby, Node.js, Python, Elixir, Erlang & more)! I myself used nvm for years until I was finally introduced to asdf. nvm is a well-tried and well-known version manager for Node (like pyenv or virtualenv for Python). To quickly switch between versions, many people use nvm (node version manager). Older projects may still be running on Node 10 or 12, while newer ones already use Node 14. If you work a lot with Node projects, it often happens that you need to change the Node version.
