UPM refresh with Error Request failed with status code [405]

Since Unity 2019.4 UPM tries to update list of packages and can use “…/-/v1/search…” request.
If manifest.json contains github package registry (https://npm.pkg.github.com/) UPM will show nexterror:

Cannot perform upm operation: Request [GET https://npm.pkg.github.com/@XXXXXXX/-/v1/search?text=com.YYYYYY&from=0&size=250] failed with status code [405] [NotFound]

There is a post on forum (from Unity person) that contains reason why UPM can’t load packages: Using GitHub Packages Registry with Unity Package Manager

Question is:
How to prevent UPM from (/-/all or /-/v1/search) requests to particular registries?

Hey there.

Unfortunately, this is not possible, we don’t distinguished between registries and their configurations and their limitations.

As discussed in other threads, GitHub Packages registries with the Unity Package Manager are not officially supported. Sometimes, they might work but GitHub breaks it from time to time, which is why we don’t recommend users to use them.

The registry used by yourself should be NPM compatible. We don’t explicitly list the features from NPM we expect the registry to implement, but having at least on search API point is expected.