npm ERR! code EBADENGINE
This error matches known, documented patterns with reliable solutions.
Quick Fix (Most Common Solution)
- Update Node.js to required version
- Use nvm to switch versions
Seeing "npm ERR! code EBADENGINE"? This error can be frustrating, but it's usually fixable. It typically affects your development workflow or system. Below you'll find clear, step-by-step solutions to resolve this issue.
What This Error Means
The package specifies engine requirements your Node.js does not meet.
Frequently documented in developer and vendor support forums.
Not affiliated with browser, OS, or device manufacturers.
New here? Learn why exact error messages matter →
Common Causes
- Node.js version too old
- Node.js version too new
- Package has strict engine requirement
How to Fix
- Update Node.js to required version
- Use nvm to switch versions
- Use --ignore-engines flag if compatible
Last reviewed: March 2026 How we review solutions
Why This Happens
EBADENGINE fires when a package declares a required Node.js version range in its package.json "engines" field and your current Node.js version falls outside that range. npm 7 and later enforce engine requirements by default, whereas npm 6 only warned about mismatches. This behavioral change catches many developers off guard when upgrading Node.js or npm. The package author specifies engines to prevent installation on untested runtimes—for example, a package using the Node.js fetch API (available from Node 18) will set "engines": { "node": ">=18" } to block installation on Node 16. The error is protective: running code on an unsupported Node version can produce subtle bugs, missing APIs, or outright crashes that are much harder to diagnose than a clear install-time error. Teams that manage multiple projects often encounter EBADENGINE because each project may target a different Node version, and switching between them without a version manager like nvm or fnm means the global Node version drifts. CI pipelines are equally vulnerable when the pipeline's Node version is set globally and not pinned per project.
Quick Diagnostic Checklist
- Run node --version to see your current Node.js version
- Read the error message for the required version range
- Check the package's package.json "engines" field on npmjs.com
- Use nvm install
or nvm use to switch Node versions - If you cannot change Node versions, try npm install --ignore-engines (risky)
EBADENGINE error and resolution with nvm
# Error output:
# npm ERR! code EBADENGINE
# npm ERR! engine Unsupported engine
# npm ERR! engine Not compatible with your version of node/npm.
# npm ERR! notsup Required: {"node":">=18.0.0"}
# npm ERR! notsup Actual: {"node":"16.20.2","npm":"8.19.4"}
# ^^^^^^^^^^^^^ Your Node is too old
# Step 1: Check your current version
$ node --version
v16.20.2 # <-- Below the required >=18.0.0
# Step 2: Install the required version with nvm
$ nvm install 18 # Downloads and installs Node 18 LTS
$ nvm use 18 # Switches to Node 18 for this shell
$ node --version
v18.19.0 # <-- Now meets the requirement
# Step 3: Re-run npm install
$ npm install # Should succeed without EBADENGINE
# Step 4: Pin the Node version for the project
$ echo "18" > .nvmrc # Create .nvmrc so nvm auto-switches
# Team members can now run: nvm use (reads .nvmrc automatically)
Edge Cases & Unusual Scenarios
Transitive dependency engine mismatch
The package you directly depend on may support your Node version, but one of its dependencies may not. The error message shows the nested package name—check that specific package rather than your direct dependency.
Docker image with wrong Node version
If your Dockerfile uses node:16-alpine but your package.json requires Node 18+, the build will fail with EBADENGINE inside the container. Update the FROM line to match the required version.
Global npm version conflict
Some packages also enforce npm version requirements. Even with the right Node version, an outdated npm can trigger EBADENGINE. Run npm install -g npm@latest to update npm independently of Node.
Optional follow-up
Some users ask whether saving fixes for recurring errors would be useful when the same issue appears again.
Was this explanation helpful?
Frequently Asked Questions
How do I check required version?
Look at engines field in package.json.
Can I force install?
Use --ignore-engines but package may not work.
What does --ignore-engines do?
It tells npm to skip engine version checks entirely. The package will install, but it may fail at runtime if it uses APIs not available in your Node version. Use this only as a temporary workaround.
How do I set Node version requirements for my own project?
Add an "engines" field to your package.json: "engines": { "node": ">=18.0.0" }. This warns (npm 6) or blocks (npm 7+) users from installing on incompatible versions.
Why does EBADENGINE appear after updating a single package?
The updated package or its new dependencies may require a newer Node version than before. Check the changelog or release notes for the updated package to see if they bumped their minimum Node requirement.
Related Resources
Also Known As
- npm install error
- npm dependency error
- node package manager error
- npm ERR! message
Common Search Variations
- "npm install not working"
- "npm ERR how to fix"
- "node modules error fix"
- "npm install failed what to do"
- "npm dependency conflict solution"
- "why does npm install fail"
Related Errors
Still Stuck?
Paste a different error message or upload a screenshot to get help instantly.