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 ERR! code ENOAUDIT npm ERR! Audit endpoint not supported
How to fix "npm ERR! code ENOAUDIT - Audit endpoint not supported"
npm ERR! code EBADDEVENGINES npm ERR! devEngines.runtime incompatible with current node version
How to fix "npm ERR! code EBADDEVENGINES - devEngines.runtime incompatible with current node version"
npm ERR! code ETOOMANYARGS npm ERR! Too many arguments
How to fix "npm ERR! code ETOOMANYARGS - Too many arguments"
npm ERR! code EINVALIDTAGNAME npm ERR! Invalid tag name: tag names cannot contain spaces
How to fix "npm ERR! code EINVALIDTAGNAME - tag names cannot contain spaces"
npm ERR! code E400 npm ERR! 400 Bad Request
How to fix "npm ERR! code E400 - 400 Bad Request" error