HTTP Status code 405 when using GitHub's NPM registry as scoped registry

Hi,

this is an issue I get when using GitHub’s NPM registry as Scoped Registry with UPM.
The issue looks it’s on GitHub’s side, as it only occurs with GitHub’s (and GitHub Enterprise’s) registries, but since Unity is doing the unsupported queries, I might file it as well here.

This is the error message printed by Unity:

[Package Manager Window] Cannot perform upm operation: Unable to perform online search:
Request [GET https://npm.pkg.github.com/@ KageKirin/-/v1/search?text=com.kagekirin&from=0&size=250] failed with status code [405]

The UPM’s manifest.json has the scoped registry set up like this

{
"scopedRegistries": [
{
"name": "GitHub Packages (KageKirin)",
"url": "https://npm.pkg.github.com/@ KageKirin/",
"scopes": [
"com.kagekirin"
]
}
],
"dependencies": {
"com.kagekirin.createurpshaders": "1.0.6",
}
}

So far, this setup works to fetch my package from the registry where I published it,
but it would be lovely not to get the error spam about failed searches.

Thanks for any help.

EDIT: Clean up tags added by this forum system.
EDIT: Added a space after @ and my user name to avoid user-tags being added where they don’t belong.

Hi @KageKirin ,

Yes, this is indeed because the Github.com registry service doesn’t support the npm search APIs (or more accurately, it explicitly denies serving them). There is no work currently planned to change this.

I am taking a note of your feedback however and we’ll discuss internally if anything can be done to improve the experience with non-conformant npm registries.

Thanks for the reply.
For the record, I asked the same question on GitHub side: community · Discussions · GitHub
Maybe they can come up with a solution.

As a workaround, may I suggest just adding a binary flag to the scoped registry entry, e.g. “allowSearch”, which when set to false would just not call the search API?

Cheers.

3 Likes

Has any discovered any solutions or workarounds for this issue?

Is there a solution for it? 2024 out there and this annoying error still floods the logs every day hundreds of times