-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RRFC] New command for detecting availability of a package name #676
Comments
+1, this would be super helpful. Specifically, since npm's "name similarity" algorithm isn't public, there's no way to know if a package name is publishable until you actually try to publish it. It would be great to be able to know this in advance. |
|
How much work would it be to add such a route, given that the logic already exists registry-side in publish? |
That is a question to ask the npm registry. This RFC repo is for the cli specifically. Once a route exists in any registry, implementing it in the cli would be a very easy task. |
Gotcha. Does the registry have any public venue in which to ask? Filing a support ticket is a bit of a black box. |
IMHO availability of package name and publishable are 2 separate things. A package name could be available but still not publishable due to other security reasons such as typosquat etc. To check availability @fabiospampinato lmk your thoughts and if we can close this issue for above example looks like this package was published and later unpublished and hence name not available
|
By "availability" I explicitly meant "I can publish it", not "I can download it". We need a "Can I publish a package with this name or not?" command. |
@saquibkhan indeed the reason this is important is because the question that needs answering is not "does this package exist?" but "will be i be able to publish a package with this name?" - and there currently isn't a way to do that except trying to do the actual publish. |
I just hit a fun instance of this issue: I just published the v1.0.0 of a new package named "dettle-batch", problem is I can't see it on the website, and neither with So now I'm in a weird kind of limbo, did I actually publish this thing, or was there already a private module with this name? I can try pushing a nonsense v1.0.1 I guess just to prod the registry, but like really there should just be dedicated commands for this stuff, prodding the registry with releases is what cavemen did. |
Motivation ("The Why")
It's kind of impossible to know if a package name is available without trying to publish a package with that name. As a result sometimes it's very frustrating to develop a new package, because once you are done NPM tells you that the name is already taken, often with an obscure error message, and you need to find another one.
Example
For example, NPM tells me that the ansi-strip package doesn't exit (https://www.npmjs.com/package/ansi-strip), but then I try to publish it and it tells me "npm ERR! 400 Bad Request - PUT https://registry.npmjs.org/ansi-strip - Cannot publish over previously published version "1.0.0", as if the package exists (I guess it's a private one or something?), and as if I've already published v1.
How
Current Behaviour
Frustration.
Desired Behaviour
Something like
npm available ansi-strip
that tells you if you can publish a new package with that name or not.References
The text was updated successfully, but these errors were encountered: