Cause of npm WARN EBADENGINE?

Viewed 37217

When generating a package-lock.json file with npm install, I get this error:

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'app@1.0.0',
npm WARN EBADENGINE   required: { node: '16.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.10.0', npm: '7.24.0' }
npm WARN EBADENGINE }

A little confused here. It requires node v16.0.0, and that's the one I'm using. And isn't npm v7.x.x compatible with that version of node?

3 Answers

You are using 16.10.0, but the message says it requires 16.0.0. Not 16.0.0 or greater. It requires exactly 16.0.0.

If it's your package.json with the engines field causing this issue, change it to say 16.0.0 or greater:

  "engines": {
    "node": ">=16.0.0"
  },

If you are using nvm run

nvm install 18.1.0
nvm use 18.1.0

If you don't have nvm installed follow this tutorial

at package.lock.json, do this:

 "engines": {
    "node": ">=0.7.0 <16.15.0"
  }

This will almost support all nodejs npm modules.

see this line

npm WARN EBADENGINE   required: { node: '>= 0.8.0 < 0.11.0' },

this meant node engine should have range anywhere between 0.8.0 and 0.11.0, e.g. engines": {"node": ">=0.7.0 <16.15.0"} or engines": {"node": ">=0.9.0 <11.15.0"} etc.

Related