Skip to content

Commit

Permalink
fix(publish): catch publish conflict 403 error from npm (#3753)
Browse files Browse the repository at this point in the history
  • Loading branch information
fahslaj committed Jun 27, 2023
1 parent c59b45b commit 6123e86
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libs/commands/publish/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,11 @@ class PublishCommand extends Command {
return pkg;
})
.catch((err) => {
if (err.code === "EPUBLISHCONFLICT") {
if (
err.code === "EPUBLISHCONFLICT" ||
(err.code === "E403" &&
err.body?.error?.includes("You cannot publish over the previously published versions"))
) {
tracker.warn("publish", `Package is already published: ${pkg.name}@${pkg.version}`);
tracker.completeWork(1);

Expand Down

0 comments on commit 6123e86

Please sign in to comment.