One install puts every command on your PATH:

npm install -g @nubjs/nub
nub index.ts             # run a TypeScript file
nub install              # install dependencies (pnpm-compatible)
nub run dev              # run a package.json script
nubx prisma generate     # run a CLI from node_modules/.bin

Every augmentation uses Node's own public extension surfaces, and the package manager reads and writes whatever lockfile your project already uses.

The toolkit

CommandWhat it doesInstead of
nub <file>Runs JS and TS files, with .env loading and modern globalsnode, tsx, ts-node, dotenv-cli
nub runRuns package.json scripts, 24× faster than pnpm runnpm run, pnpm run, yarn run
nubxRuns a local CLI, or fetches one from the registrynpx, pnpm dlx, pnpm exec, yarn dlx
nub installInstalls dependencies against your existing npm, pnpm, or bun lockfilenpm, pnpm, yarn
nub watchRestarts on changes to the import graph, .env* files, and tsconfig.jsonnodemon, node --watch, tsx watch
nub nodePins a Node version and provisions it from nodejs.orgnvm, fnm, n, volta
nub pmProvisions the exact package manager a project pinscorepack

Install

Install from npm, or with pnpm add -g or yarn global add. Any of these puts nub, nubx, and nubr on your PATH.

npm install -g @nubjs/nub

The other channels:

brew install nub                                   # macOS and Linux
mise use -g nub                                    # mise
curl -fsSL https://nubjs.com/install.sh | bash     # install script

For containers, the official image ghcr.io/nubjs/nub is a node base with Nub layered on. See Docker.

FROM ghcr.io/nubjs/nub

In CI, swap actions/setup-node for the setup-nub action:

- uses: actions/setup-node@v4
- uses: nubjs/setup-nub@v0

Nub runs on macOS (arm64, x64), Linux (x64, arm64), and Windows (x64, arm64). It needs Node 18.19+ and provisions the version your project pins.

Install script

The install script puts a native binary in ~/.nub and adds it to your PATH. It verifies the archive against the release's SHA-256 checksum before replacing an existing install.

curl -fsSL https://nubjs.com/install.sh | bash          # macOS / Linux
powershell -c "irm https://nubjs.com/install.ps1 | iex"  # Windows

Two environment variables customize it. Set them on the shell that runs the script, the right side of the pipe:

# NUB_INSTALL_DIR: install somewhere other than ~/.nub
# NUB_NO_MODIFY_PATH: truthy (1, yes, true, on) to skip the profile edit
curl -fsSL https://nubjs.com/install.sh \
  | NUB_INSTALL_DIR="$HOME/.local/nub" NUB_NO_MODIFY_PATH=1 bash

On Windows, set $env:NUB_INSTALL_DIR and $env:NUB_NO_MODIFY_PATH before the irm | iex.

Upgrading

Upgrade through the channel you installed with. A script install upgrades itself in place.

npm install -g @nubjs/nub@latest     # npm
brew update && brew upgrade nub      # Homebrew
nub upgrade                          # install script, mise
nub upgrade --version <version>      # reinstall or pick a version

On a mise install, nub upgrade runs mise upgrade --bump nub, which updates the version in the mise config that selects Nub in the current directory: a project's mise.toml or your global config.

Nub and Node version independently. Upgrading Nub does not change the Node your project pins.

Package management

The installer is pnpm-compatible at the CLI and lockfile-compatible with whatever your project already uses. The npm, pnpm, and bun lockfiles round-trip; yarn's is read-only.

nub install              # resolve + link node_modules, existing lockfile
nub add -E -D react      # exact pin, devDeps — pnpm flag spelling
nub remove lodash
nub update
nub ci                   # frozen-lockfile install

The installer is optional: keep your existing package manager and use Nub for everything else. See install for lockfile fidelity per incumbent, and pm for provisioning the exact package-manager version a project pins.

Configuration

To change a default, put a nub.jsonc at the project root:

nub.jsonc
{
  "$schema": "https://nubjs.com/schema/latest.json",

  "preload": ["./instrumentation.ts"],   // loaded before the entry file
  "envFile": [".env.local"],             // these instead of the defaults
  "tsconfig": "./tsconfig.runtime.json", // the runtime's TypeScript config

  "install": {
    "minimumReleaseAge": "3d"            // refuse deps newer than 3 days
  }
}

Unknown keys and invalid values stop the command with an error. See nub.jsonc for every field.

Offline docs

Nub bundles these docs for offline reading. The bare command prints usage and a table of contents.

nub agent docs
nub agent docs --page /docs/run  # one page, as Markdown
nub agent docs --list            # only the table of contents

Next steps

  • Runtime — what nub <file> adds on top of Node.
  • Guides — migrating from Bun, NestJS, and Turborepo.
  • FAQ — short answers to common questions.