How to fix npm ERR! code EDEPRECATED npm ERR! This version has been deprecated in npm

npmBEGINNERLOWUpdated Dec 6, 2025· 144 views

Deprecation warnings appear when npm packages or versions are no longer maintained. While installations usually succeed despite warnings, update to newer versions or alternatives to avoid security risks and ensure continued support.

Quick fix

Fixes EDEPRECATED

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
  1. Identify the deprecated package
  2. Check if it's a direct or transitive dependency
  3. Update direct dependencies
  4. Update transitive dependencies
npm — error
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code EDEPRECATED
npm ERR! This version has been deprecated

What this error means

Deprecation warnings (usually shown as npm WARN, not npm ERR) indicate that a package or specific version has been marked as deprecated by its maintainer. This doesn't prevent installation—the package will still be installed and work—but signals that you should migrate to an alternative. Packages are deprecated for various reasons: security vulnerabilities were discovered, a better alternative exists, the maintainer stopped supporting it, or the package has been replaced by built-in functionality. The npm registry allows maintainers to attach deprecation messages explaining why and suggesting alternatives. While not an error per se, ignoring deprecation warnings can leave your project vulnerable to security issues and compatibility problems as the ecosystem moves on.

Typical symptoms

  • npm WARN deprecated messages during install
  • Warnings reference specific package versions
  • Messages often include migration guidance or links to GitHub issues
  • npm audit shows vulnerabilities in deprecated packages
  • Package works but displays warnings on every install
  • Transitive dependencies show deprecation warnings for packages you didn't directly install

Common causes

  1. Direct dependency on a deprecated package version
  2. Transitive dependency (a package you depend on uses deprecated packages)
  3. Package maintainer deprecated the entire package in favor of alternatives
  4. Specific version deprecated due to security vulnerability
  5. Package replaced by Node.js built-in functionality
  6. Abandoned or unmaintained packages marked deprecated

How to fix "npm ERR! code EDEPRECATED npm ERR! This version has been deprecated"

1Identify the deprecated package

Look at the warning message:

bash
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

This tells you the package name, version, and often a link explaining why and suggesting alternatives.

2Check if it's a direct or transitive dependency

Find out why the deprecated package is in your project:

bash
npm ls request

This shows the dependency tree. If it's nested under another package, you need to update that parent package (or wait for them to update).

3Update direct dependencies

If it's your direct dependency, update to the latest version:

bash
npm install package-name@latest

Or switch to the recommended alternative. Common migrations:
- request → axios or node-fetch
- moment → date-fns or dayjs
- node-uuid → uuid

4Update transitive dependencies

If the deprecated package comes from another dependency, update that parent:

bash
npm update parent-package

If the parent package hasn't updated yet, you can:
1. Open an issue on their GitHub asking them to update
2. Use npm overrides to force a newer version (if compatible)
3. Find an alternative to the parent package

5Use npm overrides for transitive dependencies

Force a specific version of a nested dependency (npm 8.3+):

json
{
  "overrides": {
    "deprecated-package": "newer-version"
  }
}

Warning: This may cause compatibility issues if the parent package relies on specific behavior of the old version.

6Suppress warnings during install (not recommended)

If you must proceed without addressing warnings:

bash
npm install --loglevel=error

This hides warnings but doesn't fix the underlying issues. Only use for CI logs where you've already acknowledged the deprecations.

Advanced notes

Deprecation warnings are stored in package-lock.json (npm 7+). You can query them with jq:

bash
jq '.packages | to_entries[] | select(.value.deprecated) | {name: .key, msg: .value.deprecated}' package-lock.json

Some widely-used deprecated packages you might encounter:
- request: Use axios, got, or native fetch (Node 18+)
- moment: Use date-fns, dayjs, or Temporal API (upcoming)
- uuid (v3 and below): Update to uuid@8+
- querystring: Use URLSearchParams (built-in)
- punycode: Use built-in URL API

For security-related deprecations, run npm audit to see if the deprecation corresponds to a known vulnerability. Security issues in deprecated packages often won't get patches.

In CI/CD pipelines, consider failing builds on deprecation warnings for security-sensitive projects. This forces timely updates rather than accumulating technical debt.

Frequently asked questions

What does "EDEPRECATED" mean?
Deprecation warnings (usually shown as npm WARN, not npm ERR) indicate that a package or specific version has been marked as deprecated by its maintainer. This doesn't prevent installation—the package will still be installed and work—but signals that you should migrate to an alternative. Packages are deprecated for various reasons: security vulnerabilities were discovered, a better alternative exists, the maintainer stopped supporting it, or the package has been replaced by built-in functionality.
How do I fix "EDEPRECATED"?
Deprecation warnings appear when npm packages or versions are no longer maintained. While installations usually succeed despite warnings, update to newer versions or alternatives to avoid security risks and ensure continued support.
What causes "EDEPRECATED"?
Direct dependency on a deprecated package version Transitive dependency (a package you depend on uses deprecated packages) Package maintainer deprecated the entire package in favor of alternatives
Is the "EDEPRECATED" error serious?
It is a low-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading