Tighten node requirements#6759
Conversation
Node 24.13.1 installs npm at 11.8.0, which causes installation issue with our package-lock.json. To avoid this, and such unexpected surprises in the future, lock the installed version to 24.13.0 which still runs 11.6.2.
In light on a patch release from Node breaking our requirement on npm, we better keep the requirement for the Node version to a specific version
While in the land of Node and npm versions, might as well check we're up to date
📋 StatsNo changes to any distributed file sizes! Action run for b6c8686 |
|
Probably don't do this 😬 It looks like Dependabot still generates package-lock.json updates using npm v11.7.0 until this merges: Similarly back in the day, unless the semver ranges matched then This was because tools like nvm and asdf shim Missing dependencies
Instead, missing packages that are automatically added or removed (depending on npm version) can often be made stable again by resolving semver resolution issues in peer and optional packages by doing this: npm update --save
npm dedupeMismatch warningsThis PR will also affect contributors on different Node.js versions managed by their admins or app stores Mismatch warnings will be logged by npm like this: npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: undefined,
npm warn EBADENGINE required: { node: '24.13.1', npm: '11.8.0' },
npm warn EBADENGINE current: { node: 'v24.13.0', npm: '11.10.1' }
npm warn EBADENGINE }Or errors for when the npm error code EBADENGINE
npm error engine Unsupported engine
npm error engine Not compatible with your version of node/npm: undefined
npm error notsup Not compatible with your version of node/npm: undefined
npm error notsup Required: {"node":"24.11.0","npm":"11.6.1"}
npm error notsup Actual: {"node":"v24.13.0","npm":"11.10.1"}Unless they're fully comfortable with and have access to |
|
@colinrotherham Cheers for pointing that out. I'll try to see if relaxing the range for |
Tightens our requirements on Node version to an exact version and updates to the latest Node and npm version (that second part can be extracted in its own PR or left).
This has been prefered over loosening our requirements on the
npmversion as running11.8.0on apackage-lock.jsongenerated with11.6.2errored from missing dependencies in thepackage-lockfile.Why
We had a couple of CI fails from Dependabot updates:
These updates try to install our project using
npm@11.8.0where ourenginesfieldin
package.jsonspecifiesnpm@11.6.2(as an exact version).PRs not updating
package.jsonandpackage-lock.jsonseem unaffected (for now), so benefit from the cached dependencies on CI.In more details
As those PRs are Dependabot updates,
package.jsonandpackage-lock.jsonhave been updated,so dependencies are not cached and npm runs.
There's a mix of things happening:
nvmrcfile only lists24, which resolves to24.13.1. That version installsnpmat11.8.0(deps: upgrade npm to 11.8.0 nodejs/node#61466 via https://nodejs.org/en/blog/release/v24.13.1)package.jsons expectsnodeat^24.11.0which24.13.1satisfiespackage.jsons file have a strict requirement fornpmat11.8.0, which11.8.0does not satisfy.Because
.nvmrconly controlls the version of Node being installed, not npm, having one with a loose requirement and one with a tight requirement led to the current situation.Because there are issues running
11.8.0with a lockfile from11.6.2, best to tighten the requirements on Node rather than loosen them.We should keep an eye on Node's releases to pick up new LTS releases.