How to fix npm ERR! code EOLDNPM npm ERR! This package requires npm version >= 8 in npm

npmINTERMEDIATEMEDIUMUpdated Dec 3, 2025· 155 views

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.

Quick fix

Fixes npm ERR! code EOLDNPM npm ERR! This package requires npm version >= 8

npm --version
# If output is 7.x or lower, you need to upgrade

node --version
# Check Node.js version too
  1. Check your current npm version
  2. Upgrade npm globally
  3. Upgrade Node.js (recommended)
  4. Retry the installation
npm — error
npm --version
# If output is 7.x or lower, you need to upgrade
node --version
# Check Node.js version too
npm ERR! code EOLDNPM
npm ERR! This package requires npm version >= 8

What this error means

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.

Typical symptoms

  • npm install fails immediately with EOLDNPM error
  • Error message shows required vs actual npm version
  • Modern packages like Next.js 12+ or React 18+ fail to install
  • Works on newer machines but fails on older systems

Common causes

  1. npm version is older than 8.0.0
  2. Node.js version bundles an older npm (Node 14 has npm 6)
  3. Package explicitly requires npm 8+ in engines field
  4. System Node.js installation hasn't been updated

How to fix "npm ERR! code EOLDNPM npm ERR! This package requires npm version >= 8"

1Check your current npm version

First identify what version you have:

bash
npm --version
# If output is 7.x or lower, you need to upgrade

node --version
# Check Node.js version too

npm 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

2Upgrade npm globally

Update npm to the latest version:

bash
# Update to latest npm
npm install -g npm@latest

# Or install specific version
npm install -g npm@10

# Verify upgrade
npm --version

Windows (run as Administrator):

bash
npm install -g npm-windows-upgrade
npm-windows-upgrade
3Upgrade Node.js (recommended)

For a complete solution, upgrade Node.js which includes a compatible npm:

Using nvm (recommended):

bash
# 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 --version

Direct download: Visit nodejs.org and download LTS version.

4Retry the installation

After upgrading, retry your npm command:

bash
# Clear any partial state
rm -rf node_modules package-lock.json

# Reinstall
npm install
5Workaround: ignore engines (not recommended)

If you cannot upgrade npm, you can bypass the check:

bash
npm install --ignore-engines

Warning: This bypasses safety checks and may cause runtime errors. Only use temporarily while planning an upgrade.

Advanced notes

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:

bash
20

And enforce with engines in package.json:

json
{
  "engines": {
    "node": ">=18.0.0",
    "npm": ">=9.0.0"
  }
}

Frequently asked questions

What does "npm ERR! code EOLDNPM npm ERR! This package requires npm version >= 8" mean?
json engines field, and your current npm version doesn't meet that requirement. json v2 format. js 10.
How do I fix "npm ERR! code EOLDNPM npm ERR! This package requires npm version >= 8"?
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.
What causes "npm ERR! code EOLDNPM npm ERR! This package requires npm version >= 8"?
npm version is older than 8.0.0 Node.js version bundles an older npm (Node 14 has npm 6) Package explicitly requires npm 8+ in engines field
Is the "npm ERR! code EOLDNPM npm ERR! This package requires npm version >= 8" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading