diff --git a/plugins/npm/src/index.ts b/plugins/npm/src/index.ts index f9cbb0a86..d642a7cc3 100644 --- a/plugins/npm/src/index.ts +++ b/plugins/npm/src/index.ts @@ -1053,7 +1053,7 @@ export default class NPMPlugin implements IPlugin { "--exact", "--ignore-scripts", "--preid", - canaryIdentifier, + canaryIdentifier.replace(/^-/, ''), ...verboseArgs, ]); @@ -1078,7 +1078,7 @@ export default class NPMPlugin implements IPlugin { "--no-git-reset", // so we can get the version that just published "--no-git-tag-version", // no need to tag and commit, "--exact", // do not add ^ to canary versions, this can result in `npm i` resolving the wrong canary version - ...(isIndependent ? ["--preid", canaryIdentifier] : []), + ...(isIndependent ? ["--preid", canaryIdentifier.replace(/^-/, '')] : []), ...verboseArgs, ]);