sne

Change Node versions by moving one link.

sne installs Node.js and switches between versions on Windows, Linux and macOS. It is one small program, it reads the .nvmrc you already have, and it stays out of the way when you run node.

curl -fsSL https://raw.githubusercontent.com/sne-sh/sne/main/install.sh | sh

Paste it in a terminal. No root needed. Then open a new terminal and run sne install lts.

PATH never changes link one per terminal 20 22 24
$ sne use 22

Pick a version. That is the whole switch: the link moves, and every node, npm and npx in that terminal follows it.

Why it is quick

Most of the time a version manager costs you is spent on things sne does not do.

No shims
Other tools put a small program in front of node that looks up the right version on every call. With sne, node is the real Node.js binary. Nothing runs in between.
No script to load
sne is a native program written in Rust. Your shell runs it once at startup; there is no shell framework to parse on every prompt.
Installs that stream
The download is checked against the SHA-256 from nodejs.org while it arrives. On Linux and macOS it is unpacked at the same time; on Windows the zip is unpacked on several threads. Ask for several versions and they download in parallel.
No admin rights
On Windows the link is a directory junction, so you need neither an administrator prompt nor Developer Mode.

Measured on Windows 11 with the release build, averaged over 50 runs from PowerShell. Almost all of each figure is what Windows needs to start any program at all.

Installing two Node versions in parallel with sne install lts 20 took 2.4 seconds on a fast connection.

CommandTime
sne use 206.8 ms
Automatic switch when you cd6.1 ms
sne env, once per terminal7.2 ms
sne current5.9 ms
An empty cmd /c exit, for scale8.9 ms

Install

The command at the top of this page is the short way. If you would rather download a file, every release has these, each listed with its SHA-256 in SHA256SUMS.txt.

SystemFile on the releases pageHow to install it
Windows, 64-bitsne-…-x64-setup.exeRun it and follow the wizard
Windows, ARM64sne-…-arm64-setup.exeRun it and follow the wizard
Windows, portablesne-…-windows-msvc.zipUnzip and put sne.exe on your PATH
macOS, Intel and Apple siliconsne-…-macos-universal.pkgsudo installer -pkg <file> -target /
Debian, Ubuntusne_…_amd64.deb, _arm64.debsudo dpkg -i <file>
Fedora, RHEL, openSUSEsne-…x86_64.rpm, aarch64.rpmsudo rpm -i <file>
Any Linux or macOS, portablesne-…tar.gzUnpack and put sne on your PATH

Open the latest release

The Windows wizard and the macOS package are not code-signed yet, so Windows SmartScreen and macOS Gatekeeper will ask you to confirm. Packages and portable files do not touch your shell profile; add the setup line from the shell setup page yourself.

Everyday commands

A version can be 22, 22.11, latest, lts, lts/iron, a range such as >=20 <23, or a name you gave it.

sne install lts          # newest LTS release
sne install 20 22 24     # several versions, downloaded in parallel
sne install              # whatever this project asks for

sne use 22               # switch this terminal
sne use                  # switch to the project's version
sne default 22           # version for new terminals

sne ls                   # installed versions
sne ls-remote --lts      # versions you can install
sne exec 20 -- npm test  # run one command with another version
sne alias work 20        # name a version, then: sne use work
sne doctor               # check the setup
sne update               # update sne itself
sne notify on            # tell me when a new sne is out

Inside a project, sne reads .node-version, then .nvmrc, then engines.node in package.json, so projects set up for nvm or fnm work as they are.

Changelog

The changelog is kept in CHANGELOG.md on GitHub.