A standalone batch script to manage Node.js versions.
- No administrator privilege required.
- Only works for Windows Command Prompt.
The script switches between Node.js version by overriding PATH
variable using Command Prompt AutoRun.
HKCU\SOFTWARE\Microsoft\Command Processor\AutoRun
This will run when a Command Prompt terminal starts:
SET "PATH=%NVMS_NODE_HOME%;%PATH%"
- Download and place
nvms.bat
andRefreshEnv.cmd
in a folder. This will be the root folder for your Node.js installations. - Go to the folder and open
cmd
. - Run
nvms setup
. Now you can runnvms
anywhere.
C:\Users\User\AppData\Roaming\nvms>nvms setup
SUCCESS: Specified value was saved.
Environment variable NVMS_HOME is set as C:\Users\User\AppData\Roaming\nvms.
The operation completed successfully.
AutoRun command added to HKCU\Software\Microsoft\Command Processor.
C:\Users\User\AppData\Roaming\nvms is added to the environment path.
Restart the terminal for these changes to take effect.
- Run
nvms install <version>
to install a specific Node.js version. E.g.nvms install v20.10.0
. - Run
nvms use <version>
to start using that Node.js version. - Run
node -v
and check the correct Node.js is running.
C:\Users\User>node -v
v20.10.0
- Restart Command Prompt and check if the correct Node.js is running.
- RefreshEnv.cmd - Chocolatey
- nvms.bat - zqtay