Feature request: CLI command that can determine if we have permission to publish a given package #137290
Unanswered
jedwards1211
asked this question in
npm
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to make a PR to
@semantic-release/npm
to verify if the npm token has permission to publish a given package to npm, and if not, error out before doing any other semantic-release steps like creating a GitHub release, etc.Right now if publishing to npm fails, it fails after a GitHub tag and release have been created, and to get semantic-release working again, you have to manually delete the GitHub tag and release first.
If I could precheck the npm permission, then we would never wind up in a state where we have to manually fix things. The promise is this is seems impossible to determine with the commands the
npm
CLI currently provides.I was trying to use
npm access list packages $(npm whoami) <pkgname>
but there are two problems:<pkgname>
So, we need a CLI command that can definitely tell us if the npm token has permission to publish a given package. That is:
This goes for both scoped and non-scoped packages.
Beta Was this translation helpful? Give feedback.
All reactions