fleetlint Policy for a fleet of repositories
v0.11 (latest)
Getting started

repo/toolchain-pinned/node

Toolchain version is pinned

Implements repo/toolchain-pinned for node.

Severitywarning
Tiers1, 2
Stacksnode
Scopeeach
Kindexpr
Sourcelibrary v0.8.0
Selected byfleetlint-recommended@v0.8.0

Requirement

.nvmrc or .node-version names a version (not lts/* or node), a package.json here or in a parent directory has a volta pin, or .tool-versions/mise or devbox.json names node with a version. engines.node is a range and packageManager pins the package manager, not Node; neither counts. In devbox.json the package needs a version (nodejs@22, nodejs_22); @latest does not count.

Why

Without a pin, every machine and every CI run builds with whatever compiler or runtime happens to be installed, and failures cannot be reproduced.

Check

["", "../", "../../", "../../../"].exists(d, file(d + ".nvmrc") && scan(d + ".nvmrc", r'^\s*v?\d').size() > 0) || ["", "../", "../../", "../../../"].exists(d, file(d + ".node-version") && scan(d + ".node-version", r'^\s*v?\d').size() > 0) || ["", "../", "../../", "../../../"].exists(d, file(d + "package.json") && text(d + "package.json").matches(r'"volta"\s*:')) || ["", "../", "../../", "../../../"].exists(d, file(d + ".tool-versions") && scan(d + ".tool-versions", r'^\s*(node|nodejs)\s+\S*\d').size() > 0) || ["", "../", "../../", "../../../"].exists(d, ["mise.toml", ".mise.toml", ".config/mise.toml", ".config/mise/config.toml", "mise/config.toml"].exists(n,
     file(d + n) && scan(d + n, r'^\s*"?(node|nodejs)"?\s*=\s*[^#\n]*\d').size() > 0))
|| ["", "../", "../../", "../../../"].exists(d, file(d + "devbox.json") && text(d + "devbox.json").matches(r'"(nodejs|nodejs-slim)(@v?\d|"\s*:\s*("v?\d|\{[^}]*"version"\s*:\s*"v?\d))|"(nodejs(-slim)?_\d+)(@[^"]*)?"'))

Fix

Write the Node version you use to .nvmrc (e.g. node --version > .nvmrc).

Agent instruction (from repo/toolchain-pinned): Add the stack’s toolchain pin set to the version currently installed; do not upgrade the toolchain in the same change.

A finding that names no file points at .nvmrc.

Sources


Generated by fleetlint docs from catalog v0.8.0.