Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Node.js, PHP and APIs

npm warns that an old uuid version is deprecated

Errornpm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher.

Short answer

The warning comes from the package's own deprecation notice for an old uuid release. It is usually a dependency of a dependency, not your code. Run npm explain uuid to see who asks for it, update that parent, or force a newer uuid with an overrides entry in your root package.json.

  • Applies to npm 10-11, Node.js 22, Node.js 24
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Print the chain of packages that causes this copy of uuid to be installed.

    npm explain uuid
  2. 2Match what you see, then jump to its fix

    1. 1npm explain shows uuid@3.x under a package you did not add yourselfA transitive dependency still asks for the old uuidFix
    2. 2package.json lists uuid with a version of 3.xYour own project depends directly on the old uuidFix
    3. 3The parent is the latest release and still asks for the old uuidA parent package cannot be updated yetFix

What does the error look like?

  • npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher.
  • npm warn deprecated uuid@3.4.0

Cause 1 of 3

A transitive dependency still asks for the old uuid

1Check

npm explain prints the dependency chain for every installed copy of a package, up to your root project.

npm explain uuid
npm outdated

2Fix

Update the package at the top of that chain to a release that has moved on from the old uuid. If you cannot, ask its maintainers, then use the overrides fix below.

npm install <parent-package>@latest

3Verify

Run npm explain uuid again; the old copy is gone from the chain.

npm explain uuid

Confirmed by docs.npmjs.com

Did this fix it?

Cause 2 of 3

Your own project depends directly on the old uuid

1Check

Look at the range you declared.

grep -n '"uuid"' package.json

2Fix

Install the current version and use the named export. Note that from uuid 12 onward CommonJS is no longer supported, so require() code needs ESM imports or an earlier major.

npm install uuid@latest

// in code
import { v4 as uuidv4 } from 'uuid';
const id = uuidv4();

3Verify

Run your tests and confirm that the warning does not show on a clean install.

rm -rf node_modules
npm install

Confirmed by github.com

Did this fix it?

Cause 3 of 3

A parent package cannot be updated yet

1Check

Overrides replace a package anywhere in the dependency tree. They are only read from the root package.json.

grep -n -A4 '"overrides"' package.json

2Fix

Add an overrides entry with a semver range for a newer uuid, then reinstall. Test the parent package afterwards, since it was written against the old API.

{
  "overrides": {
    "uuid": "^9.0.0"
  }
}

3Verify

A fresh install no longer prints the deprecation notice.

rm -rf node_modules package-lock.json
npm install

Confirmed by docs.npmjs.com

Did this fix it?

How do I stop it coming back?

  • Run npm outdated now and then, and update the packages that sit at the top of the warnings.
  • Read npm explain before you reach for an override, because the real fix is usually a parent update.
  • Run your tests after adding any override.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Back end

ng serve says it cannot determine the project or target

Cannot determine project for command.

The Angular CLI looked through angular.json for a project that defines the target you asked for (serve, build, test) and found none, or found several and could not pick one.

3 causes, each with a fix

Back end

ng serve cannot find the dev-server builder package

Could not find the implementation for builder @angular/build:dev-server

The builder named in angular.json (for example @angular-devkit/build-angular:dev-server) is looked up as an npm package starting from the workspace root.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.