EBADDEVENGINES occurs when your development environment doesn't match the requirements specified in a package's devEngines field. Update your Node.js or npm version to match the project requirements.
The EBADDEVENGINES error occurs when npm detects that your current development environment (Node.js version, npm version, or package manager) doesn't match the requirements specified in the `devEngines` field of a package's package.json. The `devEngines` field is a newer npm feature that allows package authors to enforce specific development tools and versions for contributors. This error is stricter than a warning and indicates a version mismatch that npm considers incompatible. The `devEngines` field supports constraints for the runtime (Node.js), package manager (npm/pnpm/yarn), OS, CPU architecture, and libc version.
First, identify what versions you're currently running:
node --version
npm --versionThen check what the project requires by looking at package.json:
grep -A 10 'devEngines' package.jsonCompare your versions with the requirements.
If your npm version is outdated, update it globally:
npm install -g [email protected]Or use a version range that matches the project:
npm install -g npm@^10.9.0Verify the update:
npm --versionUse a Node version manager like nvm to switch to the required Node version:
# Using nvm
nvm install 22.0.0
nvm use 22.0.0
# Using fnm
fnm install 22.0.0
fnm use 22.0.0Create or update a .nvmrc file to lock the version for your team:
echo '22.0.0' > .nvmrcAfter updating your tools, perform a clean install:
# Remove node_modules and lock files
rm -rf node_modules
rm -f package-lock.json
# Clear npm cache
npm cache clean --force
# Reinstall dependencies
npm installIf you can modify the project's package.json, consider making devEngines more flexible:
Before (too strict):
{
"devEngines": {
"packageManager": {
"name": "npm",
"version": "10.9.0",
"onFail": "error"
}
}
}After (uses semver ranges):
{
"devEngines": {
"packageManager": {
"name": "npm",
"version": "^10.9.0",
"onFail": "warn"
}
}
}Change onFail from error to warn to make the check non-blocking.
If the error only occurs in CI/CD pipelines, update your CI configuration. For GitHub Actions:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- run: npm installEnsure CI installs the Node and npm versions specified in devEngines.
The devEngines field is a relatively new npm feature (introduced in npm v10.7.0) that distinguishes between engines (constraints for end users) and devEngines (constraints for developers). There's a known bug where simply having a devEngines field present disables the older engines field checks. The onFail option can be set to 'error' (blocks installation), 'warn' (shows warning but continues), or 'ignore' (no validation).
npm notice access token expired or revoked. Please try logging in again.
Token has expired - npm authentication failure
npm ERR! code EAI_AGAIN
How to fix "EAI_AGAIN" in npm
npm error code E403 npm error 403 Forbidden - PUT https://registry.npmjs.org/<package>
How to fix 'E403 Forbidden' error in npm
npm ERR! code EUSAGE npm ERR! Usage error
How to fix "npm ERR! code EUSAGE" in Node.js projects
npm ERR! code E401 npm ERR! 401 Unauthorized
How to fix "E401 Unauthorized" in npm