Managing Multiple Node.js Versions with asdf

Tadashi Shigeoka ·  Tue, August 23, 2022

I’ll introduce how to install and manage multiple versions of Node.js using the asdf plugin asdf-nodejs.

asdf-nodejs

Background: Node.js Version Management with asdf

I had been using nvm for Node.js version management until now, but since I started using asdf, I migrated from nvm to asdf-nodejs.

Installing the asdf-nodejs Plugin

asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git

asdf-nodejs Command List

asdf list all nodejs

Installing the Latest Version of Node.js with asdf

asdf latest nodejs

18.9.0
asdf install nodejs latest
asdf list

nodejs
  18.9.0
asdf current

nodejs          ______          No version is set. Run "asdf  nodejs "

Setting Global Environment to Use the Latest Node.js Version with asdf

asdf global nodejs latest
asdf current

nodejs          18.9.0          /Users/your_name/.tool-versions
cat ~/.tool-versions

nodejs 18.9.0

Installing Node.js LTS with asdf

asdf install nodejs lts
asdf list

nodejs
  16.17.0
  18.9.0
  lts

Setting Current Directory to Use Node.js LTS with asdf

asdf local nodejs lts
asdf current

nodejs          lts             /Users/your_name/sample/.tool-versions
cat .tool-versions

nodejs lts

That’s all from the Gemba, where I migrated Node.js multiple version management from nvm to asdf.