2.2 KiB
tags
| tags | ||
|---|---|---|
|
Core commands:
nvm list # installed versions
nvm list available # versions you can install
nvm install <version> # e.g. nvm install 20.18.0
nvm use <version> # switch active version
nvm uninstall <version> # remove one
Practical stuff you'll actually hit:
-
nvm useis per-shell, not per-project. Every new terminal window defaults back to whatever was last set globally — it does NOT auto-detect per-folder like nvm on Mac/Linux does. nvm-windows has no built-in.nvmrcautoswitch. -
Fake it with
.nvmrc+ a wrapper function. Add this to your PowerShell$PROFILEto auto-switch when youcdinto a folder with a.nvmrc:
function nvmrc-check {
if (Test-Path .nvmrc) {
$version = Get-Content .nvmrc -Raw
nvm use $version.Trim()
}
}
You'd need to hook this to directory changes yourself (no native hook in PowerShell) — or just manually run nvm use when you switch projects. Not worth automating unless you're juggling many projects daily.
-
Global npm packages don't carry over between Node versions. Installing
npm i -g somethingunder 24.18.1 means it's gone if younvm use 20.x. Reinstall globals per version you actually use. -
nvm userequires admin the FIRST time after a fresh nvm-windows install, then not after — it's flipping a symlink atC:\Program Files\nodejs. If PowerShell isn't elevated the first time, you'll get silent permission failures. You already got it working, so this is a non-issue now, but keep it in mind after Windows updates or profile changes. -
Check
npm config get prefix— with nvm-windows this should point to the nvm symlink path, not a per-user AppData path. If a global tool ever "disappears" after switching versions, that's why — it's expected, not broken. -
LTS vs current:
nvm install ltsgrabs whatever's tagged LTS at install time — it does NOT auto-update to newer LTS releases later. You'll need to rerunnvm install ltsperiodically andnvm usethe new one.
That covers what actually bites people. Anything specific you're about to do with it (global CLI tools, multiple project versions, etc.) — I can give exact commands.