Error Knowledge Base npm E409

npm ERR! code E409

npm received HTTP 409 Conflict because that package version already exists or the registry state conflicts with the publish request.

What This Error Means

npm received HTTP 409 Conflict because that package version already exists or the registry state conflicts with the publish request.

Read this as a precise clue about which part of the workflow broke first. Once you know the failing layer, the fix path gets much shorter.

How to Fix It

Check which registry npm is using:npm config get registry

If the package is scoped, verify scope registry mapping in .npmrc (example: @your-scope:registry=...).

You cannot overwrite an existing version on npm registries. Bump the version and publish again.

Confirm what is already published:npm view <pkg> versions --json

Why It Happens

Usually this comes down to the version is already published (most common), the package metadata is invalid or violates registry policy, or you are publishing to the wrong registry or scope.

Verify the Fix

Run npm view <pkg>@<version> and confirm the new version exists after publish, and re-run publish and confirm the registry accepts it.

Manual validation checklist

Preview what will be published with npm pack --dry-run (or npm pack and inspect the tarball), and confirm effective registry with npm config get registry.

Examples

npm ERR! code E409

How npm surfaces this error

Registries treat versions as immutable. A version conflict is an expected protection. Invalid package metadata causes publish validation errors.

Prevent It From Coming Back

To prevent this, automate version bumps as part of release workflow, keep registry routing explicit for scoped packages, and validate package contents with npm pack before publishing.

Docs and source code

github.com/npm/cli/blob/417daa72b09c5129e7390cd12743ef31bf3ddb83/lib/utils/ping.js

This is a registry request path. Many resolution/publish errors happen while fetching or publishing package metadata to the registry. - GitHub

// used by the ping and doctor commands
const npmFetch = require('npm-registry-fetch')
module.exports = async (flatOptions) => {
  const res = await npmFetch('/-/ping', { ...flatOptions, cache: false })
  return res.json().catch(() => ({}))
}

Need help or found a mistake? Contact RepoFlow support for questions.

Join our mailing list