SIGN IN SIGN UP

chore: pass nodedir to node-gyp via npm_package_config env in node integration (#9822)

## What / Why

The `node-integration` workflow passed `--nodedir` as an npm **CLI
flag** to `npm install`. In npm 12 unknown configs are no longer
accepted, so this now fails with `EUNKNOWNCONFIG`:

```
npm error code EUNKNOWNCONFIG
npm error Unknown cli flag:
npm error   - --nodedir
```

(seen in the Release Integration citgm jobs, e.g. `citgm -
bcrypt@6.0.0`).

`nodedir` is a **node-gyp** option, not an npm config — it only ever
worked via npm's old "accept arbitrary config and re-export as
`npm_config_*`" behavior, which node-gyp itself notes was deprecated in
npm v11
([nodejs/node-gyp#3156](https://github.com/nodejs/node-gyp/issues/3156)).

## Change

Export `npm_package_config_node_gyp_nodedir` instead of using the CLI
flag. This is node-gyp's preferred prefix since npm v11: node-gyp reads
it directly from the environment, and npm does **not** warn on it —
unlike `npm_config_nodedir`, which currently warns and is slated to
error in npm 13.

This also matches how upstream
[nodejs/citgm](https://github.com/nodejs/citgm) supplies `nodedir` (via
env, not a CLI flag).

Applied to both the generated `.github/workflows/node-integration.yml`
and its `scripts/template-oss/node-integration-yml.hbs` template;
`template-oss-apply --lint` passes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6e300b82-303b-49ac-ae93-52d984743d5b
T
Tea Reggi committed
278df04d3f25d391af3213a243bb9f89e1d11899
Parent: b888cc9
Committed by GitHub <noreply@github.com> on 7/30/2026, 4:41:39 PM