nodeup
nodeup is a Rust-based Node.js version manager with rustup-like commands, deterministic runtime resolution, and managed alias dispatch for node, npm, npx, yarn, and pnpm.
Overview
- Manage multiple Node.js runtimes from one CLI.
- Resolve active runtime consistently with explicit, override, and default selectors.
- Use human-friendly output for operators and JSON output for automation.
- Run
node,npm,npx,yarn, andpnpmthrough one binary by executable-name dispatch.
Quick Command Reference
nodeup toolchain list [--quiet|--verbose]nodeup toolchain install <runtime>...nodeup toolchain uninstall <runtime>...nodeup toolchain link <name> <path>nodeup default [runtime]nodeup show active-runtimenodeup show homenodeup update [runtime]...nodeup checknodeup override listnodeup override set <runtime> [--path <path>]nodeup override unset [--path <path>] [--nonexistent]nodeup which [--runtime <runtime>] <command>nodeup run [--install] <runtime> <command>...nodeup self updatenodeup self uninstallnodeup self upgrade-datanodeup completions <shell> [command]
Runtime Resolution Precedence
Runtime resolution follows a stable order:
- Explicit selector (
run <runtime>,which --runtime <runtime>) - Directory override (
override set) - Global default (
default)
If no selector resolves, commands fail with deterministic not-found errors.
packageManager Support
nodeup resolves package.json from the current working directory upward and supports
the packageManager field for yarn and pnpm commands.
- Supported format:
<manager>@<exact-semver> - Supported managers:
yarn,pnpm - Strict behavior:
- if
packageManagerexists, requested command must match manager - mismatches fail with
conflict - malformed values fail with
invalid-input
- if
- Corepack is not used;
nodeupuses the selected runtime'snpm exec.
Mapping rules:
pnpm@x.y.z->npm exec --package pnpm@x.y.z -- pnpm ...yarn@1.x.y->npm exec --package yarn@1.x.y -- yarn ...yarn@2+->npm exec --package @yarnpkg/cli-dist@x.y.z -- yarn ...
Fallback rules when packageManager is absent:
- if runtime provides
bin/yarnorbin/pnpm, run it directly - otherwise run through
npm execwith defaults:yarn->@yarnpkg/cli-distpnpm->pnpm
Output and Logging
- Global output mode:
--output human|json(default:human) humanmode:- command results and logs are written for operators
- default log filter is
nodeup=infofor management commands
jsonmode:- success payloads are written to stdout as JSON
- handled failures are written to stderr as JSON envelopes
- fields:
kind,message,exit_code messagefollows<cause>. Hint: <next action>for actionable recovery guidance
- fields:
- default logging is off unless explicitly enabled via
RUST_LOG
completionscommand:- always writes raw completion script text to stdout
- does not wrap completion output in JSON, even when
--output jsonis set
Human output color control:
- Global color mode for human output:
--color auto|always|never(default:auto) - Environment override for human output:
NODEUP_COLOR=auto|always|never - Precedence:
--color>NODEUP_COLOR>NO_COLOR>auto autoenables ANSI styles per stream only when the stream is a terminal--output jsonnever injects ANSI styles into JSON payloadscompletionsoutput remains raw shell script text even when--color alwaysis set
Log color control:
NODEUP_LOG_COLOR=always|auto|never(defaultalways)NO_COLORdisables color whenNODEUP_LOG_COLORis unset orauto
Completions
nodeup completions generates shell completion scripts for:
bashzshfishpowershellelvish
Scope filtering:
nodeup completions <shell>generates completions for all top-level commands.nodeup completions <shell> <command>accepts only top-level command scopes:toolchain,default,show,update,check,override,which,run,self,completions- invalid scopes fail with
invalid-input.
Testing Strategy
nodeup validation combines unit tests and end-to-end CLI integration tests.
- Unit tests cover selectors, resolver, release index cache behavior, logging mode selection, and installer helpers.
- CLI integration tests cover command contracts, JSON error envelopes, selector precedence, override lifecycle, update/check branches, self-management commands, alias dispatch (
node,npm,npx,yarn,pnpm), andpackageManager-aware execution planning.
Run locally from repository root:
Troubleshooting
- Runtime not installed:
- use
nodeup toolchain install <runtime>ornodeup run --install <runtime> ...
- use
- No selector resolved:
- set one with
nodeup default <runtime>ornodeup override set <runtime>
- set one with
- Linked runtime failures:
- verify
<path>/bin/nodeexists beforetoolchain link
- verify
- JSON parsing issues in automation:
- use
--output jsonand keepRUST_LOGunset (oroff) to avoid log noise
- use
- Error troubleshooting:
- follow the
Hint:action in the error message first, then rerun withRUST_LOG=nodeup=debugwhen deeper diagnostics are needed
- follow the
Documentation Links
- Project index:
docs/project-nodeup.md - Runtime contract:
docs/crates-nodeup-foundation.md - Public guide:
apps/public-docs/nodeup.mdx