Package with dependency from another scopedRegistry

I’m using Unity 2020.1 and let’s say I want to publish a package on the NPM Repo of my company, no problem.

So, for a user, he has to add my company ScopedRegistry in his PackageManager under ProjectSettings and he will see my package and be able to download it. OK.

But now, I want my package to use another package (as a dependency) but this package is register in another NPM Registry, from another company for example. For me, it’s ok, I added the NPM Repo of this other company in my ScopedRegistries so it’s now in my manifest.json and I can use their packages.

But the question is, how can my user who downloaded my package will be able to download the dependency which is in another repo that he doesn’t know.
In my package.json, under the “dependencies” key, it’s only written : “com.anothercompany.package”: “1.0.0” but the NPM Repo Url is not specified.

Is there a way to specify or add a new NPM Repo through the package.json ?

You need to tell your user all the dependencies and where to install them, ends up with a registries list with filled scopes information. Even custom package com.scope1.a depends on another custom package com.scope2.b in the same registry didn’t get installed, unless they share the same scope.

I hope it gets changed so

  • The Packman searches package from all registries it already knows if it didn’t find the package with a specified scope.
  • Let the package described where to search for dependencies recursively.
1 Like