geeklearningio / gl-vsts-tasks-yarn

Yarn Package Manager Visual Studio Team Services Build and Release Management extensions
MIT License
52 stars 18 forks source link

Don't clobber registry information in .npmrc #37

Closed asmundg closed 6 years ago

asmundg commented 6 years ago

When picking up registries from .npmrc, don't replace them. Adding unqualified registries will break when using multiple, namespaced registries, as yarn will attempt to use the last registry configured for all packages.

sandorfr commented 6 years ago

It rings a bell ;) Thanks

sandorfr commented 6 years ago

Now I remember I had this but doing that it just doesn't work if an npmrc is specified :(

sandorfr commented 6 years ago

do you have a sample of the kind of file you work with?

asmundg commented 6 years ago

They tend to be of this type:

@foo:registry=https://foo.pkgs.visualstudio.com/_packaging/foo/npm/registry/
@bar:registry=https://bar.pkgs.visualstudio.com/_packaging/bar/npm/registry/

If I then add registry credentials to the yarn task, I end up with multiple registry= entries, where yarn apparently tries to resolve all packages from the last such entry.

sandorfr commented 6 years ago

Thanks, I've got it to work on my test build and it's published. Can you confirm it's good for you?

asmundg commented 6 years ago

Looks good, thanks!