Closed mjackson closed 8 years ago
npm-registry-client
is due for a rewrite, for this reason and many others. If you look at how npm calls into it, you'll see that scoped package names are encoded such that /
becomes %2f
(due to legacy CouchDB-related reasons). Also, you're going to need to pass along a bearer token as auth
in the request's options
parameter to get metadata on scoped packages. It should work without auth for scoped public packages, but it definitely won't for private.
As this is all by design, I'm going to close this issue, but rest assured that a new major version of npm-registry-client
with a much less obtuse API is a high priority for the team.
Thank you for the explanation, @othiym23. For now I'm only interested in getting info on public scoped packages. Is there a workaround for the encoding issue? From the error message, it looks like the registry is only recognizing @cycle
as the package name, not @cycle/core
.
Perhaps there is a straight-up HTTP endpoint I could hit to get data about packages? I'm only ever doing GET
s, so I actually don't need most of the fancy stuff npm-registry-client gives me.
Ah, nm. I just followed the source and found out how to call it. Thanks again, @othiym23!
@mjackson could you share how you call it with scoped packages? thanks
That's how you encode the package name in the registry URL.
@mjackson thanks!
I can't seem to use the
get
method to fetch package info about scoped packages. In my node prompt:Am I doing something wrong?