explaingit

tj/n

19,518ShellAudience · developerComplexity · 2/5MaintainedLicenseSetup · easy

TLDR

A simple command-line tool to install and switch between different Node.js versions on your computer without reinstalling.

Mindmap

mindmap
  root((repo))
    What it does
      Switch Node versions
      Install from cache
      Read project config
    How to use
      Run n interactively
      Specify version number
      Use lts or latest
    Key features
      Fast switching
      No shell config
      Auto version detection
    Tech stack
      Bash shell script
      macOS Linux WSL
    Use cases
      Multi-project work
      Version testing
      Team setup

Things people build with this

USE CASE 1

Switch between Node.js versions when working on multiple projects with different requirements.

USE CASE 2

Quickly test your code against different Node.js versions to ensure compatibility.

USE CASE 3

Automatically use the correct Node.js version specified in your project's .nvmrc or .node-version file.

USE CASE 4

Set up a development environment with the latest LTS Node.js version in seconds.

Tech stack

BashShell scriptNode.js

Getting it running

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

n is a command-line tool for managing multiple versions of Node.js on the same computer. Node.js is the JavaScript runtime used to build server-side applications and run development tools. Different projects often require different Node.js versions, and n makes it easy to switch between them without manually uninstalling and reinstalling. The tool is intentionally simple: run n on its own to see a list of your installed Node.js versions with an interactive menu you can navigate with arrow keys, then press Enter to activate the one you want. Run n lts to download and install the latest Long Term Support version. Run n 20.12.2 for a specific version number. When a version has already been downloaded, n installs from its local cache, making switches nearly instant. You can also specify a version using labels like lts, latest, or auto, the auto label reads the required version from a .nvmrc, .node-version, or .n-node-version file in the project directory, which is useful when working across projects that specify their own Node.js requirements. n is written as a Bash shell script and works on macOS, Linux, and Windows Subsystem for Linux. It does not require changes to your shell profile (no subshells, no complex initialization) beyond ensuring the install location is on your PATH. Installation can be done via npm, Homebrew, or by downloading the script directly with curl.

Copy-paste prompts

Prompt 1
Show me how to install n and use it to switch between Node.js versions 18 and 20.
Prompt 2
How do I configure my project to automatically use a specific Node.js version with n?
Prompt 3
I need to test my app on Node.js 16, 18, and 20. How do I use n to manage all three?
Prompt 4
Set up n on my Mac and install the latest LTS Node.js version.
Prompt 5
How do I use n to read the Node.js version from a .nvmrc file automatically?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.