Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@jchip/nvm

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jchip/nvm

nvm: a universal node.js version manager for Windows (no admin) and Unix

Source
npmnpm
Version
1.8.4
Version published
Weekly downloads
106
-41.44%
Maintainers
1
Weekly downloads
 
Created
Source

@jchip/nvm

A universal node.js version manager for Windows (no admin) and Unix.

  • Install is simple with a PowerShell script on Windows, or a bash script on Unix.

  • No admin required on Windows to install or use.

  • A linked system wide version that can be changed any time.

  • Change to any version independently in a terminal any time.

Table Of Contents

Installing Windows nvm using PowerShell

You don't need admin rights to install or use, only the permission to execute PowerShell scripts.

Tested on Windows 10, 8.1, and 7. Windows 7 requires PowerShell updates, see update instructions.

To install, start a Windows PowerShell and copy and paste one of the scripts below into the shell terminal and press enter.

  • This will install nvm and current LTS Node.js (v12.13.0) to directory nvm under your home specified by $Env:USERPROFILE.

  • If you want to install this under another directory, then set it with the param -nvmhome.

  • If you don't set it, then $Env:NVM_HOME will be checked, and if non-existent, then a Directory Browser dialog will be opened for you to create and choose a directory.

Video Demo of upgrading Windows 7 to PowerShell 5.1 and then installing this

You can retrieve the install script from multiple sources. Listed below are three options for you to choose from in case one of them is down.

Installing from github.com

Retrieve install script from github.com directly:

cd $Env:USERPROFILE;
Invoke-WebRequest https://raw.githubusercontent.com/jchip/nvm/v1.8.4/install.ps1 -OutFile install.ps1;
.\install.ps1 -nvmhome $Env:USERPROFILE\nvm;
del install.ps1

Installing from unpkg.com

Retrieve install script from unpkg.com:

cd $Env:USERPROFILE;
Invoke-WebRequest https://unpkg.com/@jchip/nvm@1.8.4/install.ps1 -OutFile install.ps1;
.\install.ps1 -nvmhome $Env:USERPROFILE\nvm;
del install.ps1

Installing from jsdelivr.net

Retrieve install script from jsdelivr.net:

cd $Env:USERPROFILE;
Invoke-WebRequest https://cdn.jsdelivr.net/npm/@jchip/nvm@1.8.4/install.ps1 -OutFile install.ps1;
.\install.ps1 -nvmhome $Env:USERPROFILE\nvm;
del install.ps1

Windows 7 Updates

PowerShell version 4+ is required.

For Windows 7, you can update it to version 5.1 with the following instructions:

After it's completed and rebooted, launch PowerShell and type $PSVersionTable to check.

PSVersion should be something like 5.1.#####.####

Video Demo of upgrading Windows 7 to PowerShell 5.1 and then installing this

Troubleshooting

Running scripts disabled

If you get the error:

install.ps1 cannot be loaded because running scripts is disabled on this system.

Then you need to set execution policy for PowerShell to RemoteSigned with the command:

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

See this StackOverflow question for details.

You need to keep this policy if you want to use nvm in PowerShell to switch node.js versions.

No PowerShell - Manual Install

If for some reason you absolutely can't have PowerShell or permission to install from it, then you can try to manually install following these steps:

  • Download the package zip file from https://github.com/jchip/nvm/archive/v1.8.4/.zip
    • Extract this file to your home directory. You will get a new directory nvm-1.8.4.
    • Rename it to nvm, for example: C:\Users\<username>\nvm
  • Download the zipfile https://nodejs.org/dist/v20.12.1/node-v20.12.1-win-x64.zip
    • Extract this file to C:\Users\<username>\nvm. You will get a new directory node-v20.12.1-win-x64
    • Move node.exe from that directory into C:\Users\<username>\nvm
    • (optional) You can delete the directory after if you want.
  • Open RegEdit.exe, in HKEY_CURRENT_USER/Environment
    • Add the following entries
      • NVM_HOME -> C:\Users\<username>\nvm
      • NVM_LINK -> C:\Users\<username>\nvm\nodejs\bin
    • Append the following to the entry Path
      • ;C:\Users\<username>\nvm\bin;C:\users\<username>\nvm\nodejs\bin
  • Open Command Prompt, and run nvm install lts, note the version installed, and then nvm link <version>.

Make sure to replace <username> above with your actual user name.

Using Git Bash on Windows

If you want to use nvm with Git Bash after installing on Windows via PowerShell:

  • First install nvm using PowerShell (see instructions above)
  • Open Git Bash
  • Run the setup script:
    $NVM_HOME/bin/nvm-setup.sh
    
  • Restart Git Bash or run:
    source ~/.bashrc
    

Now you can use nvm commands in Git Bash just like on Unix systems.

Installing Unix nvm

Because this is implemented in node.js, it happens to work on Unix also. It just need a different install script using bash.

To retrieve and run the install script, provided below are three options for you to choose from in case one of them is down.

Please pick one and then copy and paste it into a bash terminal to run.

Installing from github.com

Retrieve the install script from github.com:

Using cURL and the install script:

export NVM_HOME=~/nvm; curl -o- https://raw.githubusercontent.com/jchip/nvm/v1.8.4/install.sh | bash

or wget:

export NVM_HOME=~/nvm; wget -qO- https://raw.githubusercontent.com/jchip/nvm/v1.8.4/install.sh | bash

Installing from unpkg.com

Retrieve the install script from unpkg.com:

Using cURL and the install script:

export NVM_HOME=~/nvm; curl -o- https://unpkg.com/@jchip/nvm@1.8.4/install.sh | bash

or wget:

export NVM_HOME=~/nvm; wget -qO- https://unpkg.com/@jchip/nvm@1.8.4/install.sh | bash

Installing from jsdelivr.net

Retrieve the install script from jsdelivr.net:

Using cURL and the install script:

export NVM_HOME=~/nvm; curl -o- https://cdn.jsdelivr.net/npm/@jchip/nvm@1.8.4/install.sh | bash

or wget:

export NVM_HOME=~/nvm; wget -qO- https://cdn.jsdelivr.net/npm/@jchip/nvm@1.8.4/install.sh | bash

Shell Initialization on Unix

The nvm installation automatically updates your shell profile files to initialize nvm. The behavior differs between zsh and bash:

Zsh (macOS default)

For zsh users, the installer updates both .zshenv and .zshrc:

  • .zshenv: Sourced for ALL shells (interactive and non-interactive)
  • .zshrc: Sourced for interactive shells only

This means:

  • ✅ Terminal sessions have nvm available
  • ✅ Non-interactive scripts have nvm available
  • ✅ GUI applications (like VS Code) have nvm available (when combined with nvx --install-to-user)

Bash

For bash users, the installer updates .bashrc or .bash_profile:

  • .bash_profile: Sourced for login shells (macOS default)
  • .bashrc: Sourced for interactive non-login shells (Linux default)
  • Non-interactive shells: NOT sourced by default

This means:

  • ✅ Terminal sessions have nvm available
  • ❌ Non-interactive bash scripts do NOT have nvm by default

Using nvm in bash scripts:

If you need nvm in a bash script, you have three options:

  • Source the profile explicitly in your script:

    #!/bin/bash
    source ~/.bashrc
    node --version
    
  • Use a login shell with the shebang:

    #!/bin/bash -l
    node --version
    
  • Set BASH_ENV to automatically source a file for non-interactive shells:

    export BASH_ENV=~/.bashrc
    

    You can add this to your .bash_profile to make it permanent, but be aware this will affect all bash scripts system-wide.

Note: This is standard bash behavior by design - non-interactive shells have a minimal environment for performance and predictability.

Usage

Usage: nvm <command> [options]

Commands:
  nvm install <version>      install the given version of Node.js
  nvm uninstall <version>    uninstall the given version of Node.js
  nvm use <version>          use the given version of Node.js in current shell
  nvm stop                   undo effects of nvm in current shell
                                                                [aliases: unuse]
  nvm link <version>         permanently link the version of Node.js as default
  nvm unlink                 permanently unlink the default version
  nvm ls                     list all the installed Node.js versions
  nvm ls-remote              list remote versions available for install
  nvm cleanup                remove stale local caches
  nvm postinstall [version]
       Invoke custom post install script for the given version
  nvm init-env
       (windows) Generate cmd file to initialize env for nvm
  nvm undo-env               (windows) Generate cmd file to undo env for nvm

Options:
  --proxy, -p                   Set network proxy URL                   [string]
  --verifyssl, --ssl, --no-ssl  Turn on/off verify SSL certificate
                                                       [boolean] [default: true]
  --latest                      Match latest version to uninstall
  --version, -V, -v             Show version number
  --help, -?, -h                Show help. Add a command to show its help
                                                                        [string]

Error: No command given

envs:

  NVM_PROXY - set proxy URL
  NVM_VERIFY_SSL - (true/false) turn on/off verify SSL certs

Examples:

    nvm install lts
    nvm install latest
    nvm use 20
    nvm uninstall 22.3

doc: https://www.npmjs.com/package/@jchip/nvm

Environments

These env flags can be set:

namevaluesdescription
NVM_PROXYstringAn URL to a network proxy
NVM_VERIFY_SSLtrue/falseturn on/off node.js verify SSL certificates

nvx - Execute with local node_modules

The nvx command allows you to run commands from your local node_modules/.bin directory without needing to specify the full path.

Unlike npx, which can fetch and execute packages from remote npm registry, nvx is simpler and only runs locally installed packages. This makes it faster and more predictable for running project-specific tools.

Basic Usage

# Run eslint from local node_modules
nvx eslint src/

# Run prettier from local node_modules
nvx prettier --write .

# Run any locally installed CLI tool
nvx jest --watch

Show Help

nvx --help
# or
nvx -h

Installing to PATH (macOS/Linux only)

On macOS and Linux, you can optionally add the nvm bin directory to your system PATH to make nvm commands available in GUI applications (like VS Code).

This adds nvm to your user's PATH. Works with GUI applications and doesn't require sudo:

macOS:

nvx --install-to-user
# Log out and log back in for changes to take effect

Linux:

nvx --install-to-user
# Log out and log back in for changes to take effect

Install to System PATH (all users)

This adds nvm to the system-wide PATH for all users. Requires sudo:

macOS:

sudo nvx --install-to-system
# Restart your terminal for changes to take effect

Linux:

sudo nvx --install-to-system
# Log out and log back in for changes to take effect

Note for Windows users: On Windows, the installation script automatically adds both %NVM_HOME%\bin and %NVM_LINK% to your user PATH in the Windows registry. This makes nvm, node, and npm immediately available to all applications (terminal, GUI apps like VS Code, etc.) without needing to run any additional commands. The nvx --install-to-user and nvx --install-to-system commands are therefore not needed on Windows.

How it Works

The nvx --install-to-user command uses platform-specific mechanisms to make nvm available to GUI applications:

macOS:

Creates a LaunchAgent at ~/Library/LaunchAgents/com.jchip.universal-nvm.plist that runs at login to set environment variables for the user session. This makes nvm available to:

  • All GUI applications (VS Code, editors, etc.)
  • Terminal windows
  • Background processes

The LaunchAgent adds both paths to your environment:

  • ~/nvm/bin - nvm commands (nvm, nvx)
  • ~/nvm/nodejs/bin - Node.js executables (node, npm) - only available after running nvm link <version>

Linux:

Creates a systemd user environment file at ~/.config/environment.d/10-jchip-universal-nvm.conf. This file is read by systemd-based desktop environments at login and makes nvm available to:

  • All GUI applications launched from the desktop
  • Applications started by systemd user services
  • Any process in your user session

The environment file adds both paths:

  • ~/nvm/bin - nvm commands (nvm, nvx)
  • ~/nvm/nodejs/bin - Node.js executables (node, npm) - only available after running nvm link <version>

Important: The ~/nvm/nodejs/bin directory is a symlink created by nvm link <version> that points to the default Node.js version. You must run nvm link to set up a default Node.js version before GUI applications can access node and npm. The install script does this automatically.

Note: On Linux systems not using systemd, this feature may not work. In that case, you can manually add the paths to your ~/.profile or consult your distribution's documentation for setting user environment variables.

Contributing and Release

Development

  • Clone the repository
  • Install fyn globally: npm install -g fyn
  • Install dependencies: fyn install
  • Make your changes
  • Test your changes on the target platform(s)

Release Process

This project uses xrun for versioning and releasing. Do not use npm version or npm publish directly.

  • Update CHANGELOG.md - Add a new entry at the top with the version and date:

    ## X.Y.Z MMM DD, YYYY
    
    - feat: description of new feature
    - fix: description of bug fix
    
  • Bump version - Choose the appropriate version bump:

    xrun version --patch   # Bug fixes (1.7.0 -> 1.7.1)
    xrun version --minor   # New features (1.7.0 -> 1.8.0)
    xrun version --major   # Breaking changes (1.7.0 -> 2.0.0)
    
  • Release - Publish to npm:

    xrun release
    

License

MIT

Keywords

Node

FAQs

Package last updated on 13 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts