Skip to content

Wrong auth for scoped packages in private registries #2151

@donaldpipowitch

Description

@donaldpipowitch

Do you want to request a bug?
bug

What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.

When a custom registry for scoped packages is used the authentification for the default registry is used. E.g. in my project I have a .npmrc like this:

strict-ssl=false
@some-scope:registry=https://npm-registry.our-company.lan/repository/npm-registry/

In my ~/.npmrc I'm authenticated with the public npm registry:

//registry.npmjs.org/:_authToken=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Now I call $ yarn to install deps and get error Couldn't find package "@some-scope/some-package" on the "npm" registry.. (This is actually a 401 error, not 404! See #2152 for this incorrect error message.)

What is the expected behavior?

Don't use the _authToken for registry.npmjs.org when I use the private registry for @some-scope so @some-scope/some-package can be installed correctly.

Please mention your node.js, yarn and operating system version.

$ node -v
v6.9.1

$ yarn -V
0.18.0

macOS 10.12.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions