Skip to content

ci: pin Node.js to 24.22.1 in .nvmrc - #81

Merged
cryptotavares merged 1 commit into
mainfrom
cryptotavares/pin-node-24
Nov 2, 2026
Merged

cryptotavares merged 1 commit into
mainfrom
cryptotavares/pin-node-24

Conversation

@cryptotavares

Copy link
Copy Markdown
Collaborator

Pins .nvmrc to Node.js v24.22.1 instead of lts/*.

Why

lts/* now resolves to Node 26 (26.13.0 became LTS on 2026-10-28). The Check workflows job does not set a Node version, so it follows .nvmrc, and on Node 26 its yarn --immutable step fails (3 retries), which also fails All jobs pass:

node_modules/yargs/yargs:3
const {applyExtends, cjsPlatformShim, Parser, Yargs, processArgv} = require('./build/index.cjs')
ReferenceError: require is not defined in ES module scope, you can use import instead
Node.js v26.13.0

The allow-scripts install plugin runs @lavamoat/allow-scripts (3.4.2), which does require('yargs/yargs'). In yargs 17.7.2 (locked) that is an extension-less file in a "type": "module" package, which Node 26 no longer loads with require.

Run Node Check workflows
main @ e4ce5ed (Oct 29) 24.22.1 pass
main @ cc6a9cf, 0.13.0 release (Nov 2) 26.13.0 fail

Same change as MetaMask/device-mcp#53. Reproduced there: node node_modules/@lavamoat/allow-scripts/src/cli.js --help works on 24.22.1 and throws the same error on 26.13.0.

The build, lint and test jobs set their own matrix (20.x / 22.x / 24.x) and are not affected. engines stays ^20 || ^22 || >=24.

Follow-up (not in this PR)

Node 26 support for the install tooling: yargs 17.7.3 points yargs/yargs to a .cjs file and loads on Node 26 (checked locally), so yarn up -R yargs (or @lavamoat/allow-scripts 5.x) would let .nvmrc move to Node 26 later.

.nvmrc was lts/*, which now resolves to Node 26 (LTS since 2026-10-28).
The Check workflows job uses .nvmrc, and on Node 26 its install fails: the
allow-scripts plugin runs @lavamoat/allow-scripts, which loads yargs 17.7.2
(require('yargs/yargs') is an extension-less file in an ESM package) and
throws 'require is not defined in ES module scope'. Pin the supported
Node 24 release.
@cryptotavares
cryptotavares requested a review from a team as a code owner November 2, 2026 18:05
@cryptotavares
cryptotavares merged commit 46b8f55 into main Nov 2, 2026
23 checks passed
@cryptotavares
cryptotavares deleted the cryptotavares/pin-node-24 branch November 2, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants