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.
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
nodethat looks up the right version on every call. With sne,nodeis 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.
| Command | Time |
|---|---|
sne use 20 | 6.8 ms |
Automatic switch when you cd | 6.1 ms |
sne env, once per terminal | 7.2 ms |
sne current | 5.9 ms |
An empty cmd /c exit, for scale | 8.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.
| System | File on the releases page | How to install it |
|---|---|---|
| Windows, 64-bit | sne-…-x64-setup.exe | Run it and follow the wizard |
| Windows, ARM64 | sne-…-arm64-setup.exe | Run it and follow the wizard |
| Windows, portable | sne-…-windows-msvc.zip | Unzip and put sne.exe on your PATH |
| macOS, Intel and Apple silicon | sne-…-macos-universal.pkg | sudo installer -pkg <file> -target / |
| Debian, Ubuntu | sne_…_amd64.deb, _arm64.deb | sudo dpkg -i <file> |
| Fedora, RHEL, openSUSE | sne-…x86_64.rpm, aarch64.rpm | sudo rpm -i <file> |
| Any Linux or macOS, portable | sne-…tar.gz | Unpack and put sne on your PATH |
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.
sne