2025-04-21
Using asdf to solve NVM for Fish
I hadn't used Node in a while—I've mostly been working with Bun for my projects. Recently, I tried installing NVM for Fish, but it just wouldn't work.
If you're building with Bun or Node.js and want to optimize Docker builds, check out Debugging Slow Docker Builds in Next.js.
I searched around and found a solution that did the trick: asdf
Install asdf
brew install asdf
After following the instructions to configure Fish, I finally had access to Node.js.
brew install gpg gawk
Why?? Now I have to wait for Homebrew to upgrade all my packages 😭
Next, I installed the Node.js plugin, which was pretty fast:
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
Of course, I set the latest version of Node.js as the default:
asdf install nodejs latest
asdf performs a version lookup of a tool in all .tool-versions files from the current working directory up to the $HOME directory. The lookup occurs just-in-time when you execute a tool that asdf manages.
Yay!
asdf-nodejs supports this via both .nvmrc and .node-version files. To enable this, add the following to your asdf configuration file ($HOME/.asdfrc):
i definitely wont be migrating to .tool-versions
but nvmrc file support sounds like a no brainer.
touch ~/.tool-versions
~/Dev/ten/tengis.io main ?1 ❯ node -v
v23.11.0
asdf_tool_versions_enabled=true
And that's it—Node is working, Fish is happy, and I can get back to building stuff. 🎉