Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Node.js, PHP and APIs

npm refuses or warns because your Node.js version is not supported

Errornpm is known not to run on Node.js v10.24.1

Short answer

npm compares the engines field of each package with your Node.js version. Without engine-strict that is a warning. With engine-strict on, the install stops. The right fix is a supported Node.js version, set with a version manager. Forcing is the last resort.

  • Applies to npm 10, npm 11, Node.js 22, Node.js 24
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    See which Node.js and npm you run, and whether engine-strict is on.

    node -v
    npm -v
    npm config get engine-strict
  2. 2Match what you see, then jump to its fix

    1. 1The message lists a required node range and your version is below itNode.js itself is too oldFix
    2. 2The install stops instead of printing a warningengine-strict is on, so a warning became an errorFix
    3. 3The warning names your own package.json, or a lockfile-installed dependencyThe project pins an engine range that your machine does not matchFix

What does the error look like?

  • npm is known not to run on Node.js v10.24.1
  • npm will stubbornly refuse to install packages that claim to be incompatible

Cause 1 of 3

Node.js itself is too old

1Check

Check your version against the Node.js release table. Lines marked EOL there (for example v18 and v20) no longer get updates, and npm's README tells you to run a currently supported Node.js.

node -v

2Fix

Install a supported LTS version with a version manager and make it the default.

nvm install --lts
# optional: make it the default for new shells
nvm alias default <installed-version>

3Verify

Versions now show a supported line.

node -v
npm -v

Confirmed by nodejs.org

Did this fix it?

Cause 2 of 3

engine-strict is on, so a warning became an error

1Check

The engines field is advisory unless engine-strict is set. When it is true, npm refuses to install packages that claim to be incompatible. Look in the project .npmrc and your user .npmrc.

npm config get engine-strict
npm config ls -l | grep engine-strict

2Fix

Prefer a Node.js version the package accepts. If you must continue for now, the docs say --force overrides engine-strict; use it only once you know why the package needs a newer Node.js.

nvm use 24
npm install
# last resort
npm install --force

3Verify

The install finishes and npm ls shows no errors.

npm ls

Confirmed by docs.npmjs.com

Did this fix it?

Cause 3 of 3

The project pins an engine range that your machine does not match

1Check

The engines field declares the Node.js (and npm) versions a project works on. A range written years ago may exclude today's Node.js.

node -e "console.log(require('./package.json').engines)"

2Fix

If the project really works on the newer Node.js, test it and widen the range. Add an .nvmrc so teammates use the same version.

// package.json
"engines": { "node": ">=22" }

3Verify

A fresh install prints no engine warning.

rm -rf node_modules && npm install

Confirmed by docs.npmjs.com

Did this fix it?

How do I stop it coming back?

  • Use a version manager and an .nvmrc file in every project.
  • Move to a new LTS line before the old one reaches end of life.
  • Do not leave --force in scripts; it hides real incompatibilities.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Back end

ng serve says it cannot determine the project or target

Cannot determine project for command.

The Angular CLI looked through angular.json for a project that defines the target you asked for (serve, build, test) and found none, or found several and could not pick one.

3 causes, each with a fix

Back end

ng serve cannot find the dev-server builder package

Could not find the implementation for builder @angular/build:dev-server

The builder named in angular.json (for example @angular-devkit/build-angular:dev-server) is looked up as an npm package starting from the workspace root.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.