npm refuses or warns because your Node.js version is not supported
npm is known not to run on Node.js v10.24.1Short 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.
Fix it fast
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-strict2Match what you see, then jump to its fix
- 1
The message lists a required node range and your version is below itNode.js itself is too oldFix - 2
The install stops instead of printing a warningengine-strict is on, so a warning became an errorFix - 3
The warning names your own package.json, or a lockfile-installed dependencyThe project pins an engine range that your machine does not matchFix
- 1
What does the error look like?
npm is known not to run on Node.js v10.24.1npm 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 -v2Fix
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 -vConfirmed by nodejs.org
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-strict2Fix
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 --force3Verify
The install finishes and npm ls shows no errors.
npm lsConfirmed by docs.npmjs.com
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 installConfirmed by docs.npmjs.com
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 fixBack end
ng fails with Cannot find module @angular/cli/bin/ng
Cannot find module '@angular/cli/bin/ng'
The ng command is the entry point to the Angular CLI package.
2 causes, each with a fixBack end
Angular app shows 'Cannot GET /' when served by a Node.js server
Cannot GET /dashboard
Cannot GET / is Express saying no route or file matches the request.
3 causes, each with a fixBack 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 fixBack end
Angular build says it cannot resolve '@angular/localize/init'
Can't resolve '@angular/localize/init' in '/usr/src/app/src'
The build imports @angular/localize, and that package is not in node_modules.
2 causes, each with a fixBack end
The command npm run build -- --prod exited with code 1 (Angular)
The command "npm run build -- --prod" exited with code 1
Exit code 1 only says the build failed; the real message is above it.
2 causes, each with a fix