Skip to content

[FEATURE] publish should have option to silence errors about already published versions #1559

Closed
@cinderblock

Description

@cinderblock

What

Scripts that use npm publish should be able to exit with a success code if the version is already published.

Why

I've been using a CI script to build and publish a package to npm. I currently just always try to publish and just accept the error if the current version has already been published.

I'd like to be able to tell Npm: "Don't worry if I've already published this version. I just want to make sure all the other steps leading up to the publish are working as expected."

Note, this is not the same as a --dry-run. In the cases where I bump my package.json#version, I want a new version to be published.

Suggestion

A new flag for npm publish, maybe "--republish-ok" that makes npm publish exit without an error code when the package already exists in the target repository.

Related

A alternate, and possibly complimentary, flag would be to ask Npm to compare the two packs. If they don't match, then throw an exit code. Maybe it can be called "--verify-existing".

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancementnew feature or improvementRelease 6.xwork is associated with a specific npm 6 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions