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 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