Problem
When you run npm install or your Node.js app, you might see an error like:
EBADENGINE: engine “node” is incompatible with this module
This happens when the package you’re installing has incompatible Node.js version requirements in its package.json engines field and your runtime doesn’t meet those criteria.
Solution
Step 1: Check the Required Node Version
Open the library’s package.json (e.g. in node_modules or on npmjs.com) and look at:
json
“engines”: {“node”: “>=18 <20”,
“npm”: “>=8”
}
Step 2: Verify Your Node Version
Make sure you’re running a compatible version:
bash
Step 3: Upgrade or Downgrade Node
Use NVM:
bash
nvm install 22.17.1nvm use 22.17.1
If needed:
bash
Also Read:
Step 4: Override the Engine Check (when safe)
You can bypass the check during install:
bash
npm install –engine-strict=false
Or set it in .npmrc:
ini
Note: Bypassing can lead to runtime errors if there’s actual incompatibility.
Conclusion
This error means your Node.js runtime doesn’t match the module’s declared engine requirements. Fix it by matching your Node version to the module’s engine range or safely overriding the engine check.