The HTTP 409 Conflict error in npm occurs during publish operations when there's a version conflict. This usually means you're trying to publish a version that already exists or there's a concurrent modification.
Fixes npm ERR! 409 Conflict
npm view your-package versions
# Or check specific version
npm view [email protected]npm view your-package versions# Or check specific versionnpm view [email protected]npm ERR! 409 Conflict
On this page
HTTP 409 Conflict indicates that the request conflicts with the current state of the resource on the server. In npm's context, this most commonly happens when trying to publish a package version that already exists in the registry. The registry maintains strict versioning - once a version is published, it cannot be republished with different content. This ensures reproducible builds across the ecosystem.
Verify what versions are published:
npm view your-package versions
# Or check specific version
npm view [email protected]If version exists, you need a new version number.
Increment the version properly:
# Patch version (1.0.0 -> 1.0.1)
npm version patch
# Minor version (1.0.0 -> 1.1.0)
npm version minor
# Major version (1.0.0 -> 2.0.0)
npm version majorThis updates package.json and creates a git tag.
Ensure version is correct:
cat package.json | grep versionManually edit if needed, but prefer npm version for automation.
If a previous publish partially succeeded:
# Wait a few minutes for registry to sync
# Then check if it's actually published
npm view your-package@version
# If not published, try again
npm publish
# If partially published, bump version and republishIn rare cases where version doesn't truly exist:
npm publish --force⚠️ This won't override existing versions, but may help with stale registry state.
Prevent future conflicts:
// package.json - use semantic-release or similar
{
"scripts": {
"release": "semantic-release"
}
}Or use npm version in CI before publish.
npm's immutability policy means published versions cannot be changed. Use semantic versioning (semver) to manage versions properly. For monorepos, tools like Lerna or Changesets help coordinate multi-package version bumps. In CI/CD, use npm version --no-git-tag-version if git tags are managed separately. Consider using alpha/beta/rc versions for pre-releases.