The EOLDNPM error occurs when a package requires a newer npm version than you have installed. This commonly happens with modern packages that need npm 8+ features like workspaces or improved peer dependency handling.
This error indicates you're trying to install a package that specifies a minimum npm version requirement in its package.json engines field, and your current npm version doesn't meet that requirement. Modern packages increasingly require npm 8+ because it introduced significant improvements: better workspace support, improved peer dependency resolution, and package-lock.json v2 format. npm 8 was released with Node.js 16 and dropped support for Node.js 10. The engines field in package.json allows package authors to declare compatibility requirements, and when your npm version is too old, installation fails with this error.
First identify what version you have:
npm --version
# If output is 7.x or lower, you need to upgrade
node --version
# Check Node.js version toonpm version mapping:
- Node 14.x → npm 6.x
- Node 16.x → npm 8.x
- Node 18.x → npm 9-10.x
- Node 20.x → npm 10.x
Update npm to the latest version:
# Update to latest npm
npm install -g npm@latest
# Or install specific version
npm install -g npm@10
# Verify upgrade
npm --versionWindows (run as Administrator):
npm install -g npm-windows-upgrade
npm-windows-upgradeFor a complete solution, upgrade Node.js which includes a compatible npm:
Using nvm (recommended):
# Install nvm if not already installed
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
source ~/.bashrc
# Install latest LTS
nvm install 20
nvm use 20
# Verify
node --version
npm --versionDirect download: Visit nodejs.org and download LTS version.
After upgrading, retry your npm command:
# Clear any partial state
rm -rf node_modules package-lock.json
# Reinstall
npm installIf you cannot upgrade npm, you can bypass the check:
npm install --ignore-enginesWarning: This bypasses safety checks and may cause runtime errors. Only use temporarily while planning an upgrade.
npm version compatibility with Node.js:
- npm 6.x: Last version for Node 10
- npm 7.x: Introduced peer deps auto-install, workspaces
- npm 8.x: package-lock v2, dropped Node 10 support
- npm 9.x: package-lock v3, stricter validation
- npm 10.x: Current stable, requires Node 18+
For teams, use .nvmrc to standardize Node/npm versions:
20And enforce with engines in package.json:
{
"engines": {
"node": ">=18.0.0",
"npm": ">=9.0.0"
}
}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