I am trying to access Unity packages from a scoped registry server that I am running locally using Verdaccio.
What I have done so far:
I am running a scoped registry server using Verdaccio and I have successfully published a package on the server which I can verify by going on webpage hosted on the server.
In unity, I have modified manifest.json to include “scopedRegisteries”
and the package.json inside the package looks like :
What I expect:
After going through above mentioned steps, I expect Unity package to show up in Package Manger’s list.
What is the problem:
Package name is not showing up in package manager and there is no error shown in Unity.
What I also tried:
Adding “registry” in project manifest gives error.
I have tried adding and removing “/registry” from url of scoped registry:
Have you tried to manually add a package from your scoped registry into the project manifest? If not, can you try? Does the package gets added to your project?
Thanks for getting back!
yes, I tried loading the same package from disk which worked fine and I could see a new folder loaded in the “Packages” folder in Unity project.
Just to clarify, when I load the package from disk following this method: Unity - Manual: Install a UPM package from a local folder (which modifies manifest.json), the package appears in the project but when I try loading it through scoped registry server (using the method I posted above), it does not appear.
There is one more thing that I noticed.
When I start Verdaccio and then load Unity project with manifest file updated, I see following log in Verdaccio.
Package Manager uses the /-/all route to fetch the list of packages to be shown in the UI. We have an implementation in the work to fetch the list from the npm’s V1 API instead (the /-/all route is deprecated). That said, I’ve looked at Verdaccio code base and it looks like they still support the /all path. Maybe your instance is misconfigured? Can you ask the Vedaccio maintainers why this route is not available on your instance? If you do, please let us know!
I can confirm packages show up using Verdaccio when the registry is added using scopedRegistries. Just checked with Unity 2018.4 and 2019.3a and this worked with Verdaccio 3 and still works with Verdaccio 4.
@okcompute_unity : I uninstalled and reinstalled Verdaccio4. Now /-/all error is gone but for some reason I still don’t see the package name in Package manager or the folder in the Unity project.
@Adrian : Can you please post your example package that shows up?
That is weird. You should have, at least, errors if the Package Manager cannot add scoped packages in your project! Can you share your project manifest?
@chayanvinayak Here’s a package I’ve uploaded to my registry and which then appears in the package manager window:
Note that custom packages are never “verified” packages and therefore always considered “preview”. You need to have “Advanced” > “Show preview packages” checked for your packages to show up.
@chayanvinayak I’ve set up a scoped registry on my end and everything works fine. Have you selected the Advanced => Show preview packages option like @Adrian suggested?
is there any way to add dependency of a package coming from scoped registry?
sometimes even when “manifest.json” is reset Unity keeps showing older list of packages coming scoped registry (and doesn’t update package manager based on changes). Is there any folder which is needed to be cleaned to reset. (I tried cleaning “PackageCache” folder but didn’t help)?
Do you mean transitive dependency? If yes, as long as the name of the package matches the scoped registry, the Package Manager will fetch the dependency in the scoped registry. Transitive or root dependency.
This looks like a bug. Does this issue persist if you close the editor and restart? I’m wondering if this would be an issue with the UI holding on an invalid state by mistake.
Transitive dependency is defined in the package.json of the package itself?
Yes, this persists even if editor is closed and restarted. Any modification in manifest.json also doesn’t change list of packages in Package manager. Is there any way I can reset the UI?
Root or direct dependencies are set in the project manifest (/Packages/manifest.json
Transitive or indirect dependencies are set in package manifest (package.json)
Ok, then this is not a UI issue. Can you share what the project manifest look like after and before? (you can DM the files if you want).