Vercel
Vercel ships no preinstalled Nub, but the install command is yours to replace — so one line puts the CLI on PATH for the rest of the build. The devDependency pattern works too.
Vercel doesn't ship Nub in its build image, but it lets you replace the install command — which is all it takes.
Point the install command at Nub
Add both commands to vercel.json. The installer fetches a static binary, then Nub installs the dependencies and runs the build:
{
"installCommand": "curl -fsSL https://nubjs.com/install.sh | bash && export PATH=$HOME/.nub/bin:$PATH && nub install",
"buildCommand": "export PATH=$HOME/.nub/bin:$PATH && nub run build"
}Export PATH — don't call the binary by path
The installer writes to $HOME/.nub/bin, and calling $HOME/.nub/bin/nub directly looks equivalent but leaves Nub off PATH for everything it then starts. A script like "build": "nub run i18n:compile && nubx vite build" fails with nub: command not found. Because the install and build commands run as separate shells, the export belongs in both.
Deploy
Connect the repository from the Vercel dashboard, or push a deployment from the CLI:
nubx vercel deployVerify Nub ran the build
The build log names the version it installed and the Node it picked up:
Installed nub v0.6.0 (with nubx) to /vercel/.nub/bin/nub
nub 0.6.0 · ✓ Already up to date (2 packages)
$ nub run build
» node v24.15.0 (from PATH)
Build Completed in /vercel/output [3s]The Node line is the thing to check. Nub augments the Node the build machine already provisioned rather than downloading one, which is why adding it costs seconds.
The devDependency alternative
Overriding the install command isn't required. Adding the CLI as a devDependency also works and leaves vercel.json empty:
{
"devDependencies": {
"@nubjs/nub": "^0.6.0"
},
"scripts": {
"build": "nubx vite build"
}
}Vercel's auto-detected install links nub and nubx onto node_modules/.bin, and your scripts resolve them. Reach for it when you'd rather pin the version in the manifest than in build settings; see Hosted builds for the full pattern.
Excluding development dependencies from the install drops the CLI along with them. Override the install command instead when a project builds without devDependencies.
Node version
Vercel selects the Node version and Nub adopts it, so pin it on Vercel's side:
- Project Settings → Node.js Version
package.json→engines.node
Nub reads engines.node too, so that spelling keeps both in agreement from one place.
Cloudflare
Nub is preinstalled in the Cloudflare Workers Builds image, so package scripts that call it run with no setup step. Pages uses the devDependency pattern instead.
Plugins
Extend the nub CLI with your own subcommands — an unknown verb resolves to an executable named after it and runs, the same convention git and cargo use for their plugins.