docs(contributing): explain which Node.js Git hooks use (#15448)

nvm use changes Node.js only in the terminal it runs in. Hooks started
from an IDE, a Git client or an agent use the default Node.js on PATH,
and the pre-push checks fail when that version is outside the engines
range. Point contributors in that situation to ~/.config/husky/init.sh,
which Husky reads before every hook.
This commit is contained in:
morluto authored and GitHub committed 2026-12-01 01:14:45 -05:00
1 parent 1a85e2f4f5
commit 1b0612c73e
1 file changed
+5 -1
+5 -1
View File
@@ -265,7 +265,11 @@ npm run check:fast
```
`npm ci` installs the exact dependencies and prepares the Husky hooks without
building the project. Run `npm run build:cached` when you need the standalone
building the project. Git hooks use the Node.js first on `PATH` where Git
runs, which `nvm use` in one terminal does not change for IDEs, Git clients or
agents. If your default Node.js is outside `package.json#engines`, put the
pinned version first for hooks in `~/.config/husky/init.sh`, for example
`export PATH="$HOME/.nvm/versions/node/v24.22.1/bin:$PATH"`. Run `npm run build:cached` when you need the standalone
CLI or MCP server; it compiles the runtime and bundles the authored skill.
`npm run build` forces those tasks to rerun. Neither command generates test
catalogs, documentation projections, or managed verification evidence. Turbo