asdf vs nvm: Which Version Manager for CI?
nvm manages Node versions only; asdf manages many languages from one tool and a single .tool-versions file.
nvm is a focused Node version manager driven by .nvmrc. asdf is a multi-language version manager that handles Node, Python, Ruby, and more via plugins, pinned in one .tool-versions file.
| asdf | nvm | |
|---|---|---|
| Languages managed | Many (plugins) | Node only |
| Pin file | .tool-versions | .nvmrc |
| Best for | Polyglot repos | Node-only repos |
| CI usage | Install plugins per language | Often via setup-node |
| Setup weight | Heavier (plugins) | Lightweight |
In CI
For a Node-only repo, nvm (or GitHub's setup-node reading .nvmrc) is the lightest way to pin a version. For polyglot repos, asdf pins every language in one .tool-versions file, so a single tool guarantees consistent Node, Python, and Ruby versions across local and CI. asdf adds per-plugin setup but removes the need for several separate version managers.
Pin and cache
Commit .tool-versions or .nvmrc so CI uses the exact local version, and cache the installed toolchains where possible. The toolchain install runs on CI runners; faster managed runners shorten cold setup when several languages must be installed.
The verdict
Node-only repo wanting minimal setup: nvm (or setup-node with .nvmrc). Polyglot repo wanting one tool for every language: asdf with a committed .tool-versions. Pin the version file either way for reproducible CI.