openupm-cli icon indicating copy to clipboard operation
openupm-cli copied to clipboard

Can not install package with dependencies via another registry

Open nowsprinting opened this issue 1 year ago • 4 comments

Metamesh package is depend to com.unity.mathematics. And Metamesh package is published on npmjs.com.

I get an error with the following command.

$ openupm add --registry https://registry.npmjs.com jp.keijiro.metamesh

WARN 404 package [email protected] is not a valid choice of 0.0.1-security
notice suggest to install [email protected] or a replaceable version manually
ERR! missing dependencies please resolve thie issue or run with option -f to ignore the warning

I can install with the -f option, but please refer to the com.unity registry without -f option.

openupm version: 1.15.4

nowsprinting avatar Jul 17 '22 19:07 nowsprinting

This is a bit tricky.

When working with any registries (openupm registry or the one you specified), OpenUPM-CLI DOES search the unity registry as upstream for dependencies, unless --no-upstream is given.

However, it always searches the current registry first, if not found then searches the unity registry.

The registry.npmjs.com registry contains a package named com.unity.mathematics with only one version 0.0.1-security. Then the CLI reported that it's not qualified for the required version 1.2.1, and warned you to resolve it.

favoyang avatar Jul 18 '22 14:07 favoyang

The fix for this could be to search the upstream if no good version was found in the primary registry, correct?

ComradeVanti avatar Jan 16 '24 12:01 ComradeVanti

Or, we could first search for the upstream registry (Unity registry) first, and assume that it takes higher priority.

favoyang avatar Jan 17 '24 15:01 favoyang

That is also a possibility. I'll take a look.

ComradeVanti avatar Jan 18 '24 14:01 ComradeVanti