Run Node, Bun and Deno dev servers at .test

On this page

Short Leash installs Node 18, 20, 22, 24 and 26 from nodejs.org on the Runtimes screen. They're used for dev-server sites, background processes and Short Leash's terminal commands.

Node 18 and 20 no longer get security fixes from the Node project; they're there for projects that still need them. The Runtimes screen marks them End of life, as it does an older version a project's .nvmrc installed. Node 24 and 26 need macOS 13.5 or later: on an earlier macOS their rows say Needs macOS 13.5 or later and Short Leash doesn't install them, so use Node 22 or earlier.

Which version a site uses

  1. The version chosen for the site on its Site settings.
  2. Otherwise .nvmrc or .node-version in the project.
  3. Otherwise the default on the Runtimes screen.

A PHP site can use Node too: a Laravel site served by PHP 8.4 can run its Vite process with Node 22. The site's Node version applies to its background processes.

In your terminal

leash node, leash npm and leash npx run the current folder's Node version, picked the same way, and install it first if it isn't there. Outside a site they use the default:

Terminal window
leash npm run dev
leash node -v

Dev servers

Sites with a dev or start script in package.json are run with the package manager that matches the lockfile (pnpm, yarn, bun or npm). Short Leash sets PORT and proxies https://<name>.test to it, including WebSockets for hot reload. To use a different command:

Terminal window
leash run storefront "npm run dev -- --port $PORT"

Bun and Deno

A project with a bun.lock, bun.lockb or bunfig.toml runs its scripts with Bun, such as bun run dev. A project with a deno.json or deno.jsonc runs deno task dev (or start). When there's no such task, it runs the first of main.ts, main.js, server.ts or mod.ts with deno run -A --watch.

Short Leash uses the bun or deno on your PATH. When there isn't one, it downloads the newest release from GitHub the first time a site needs it, checked against the SHA-256 GitHub publishes for it. Both are listed on the Runtimes screen. Each has one version, the newest release, so there's no default to pick.