Skip to content

Yarn should allow users to override registry host in yarn.lock #3558

Closed
@OpenGG

Description

@OpenGG

I want to request a feature.

What is the current behavior?

  • When yarn.lock exists, Yarn install command will always try to access resolved url, ignoring registry in .yarnrc.
  • When the host inside resolved is not accessible, Yarn install command will fail.
  • The only way for users to override the host in resolved is modifying the lock files.

What is the expected behavior?

I suggest yarn to take npm behavior:

If you generated your package lock against registry A, and you switch to registry B, npm will now try to install the packages from registry B, instead of A. If you want to use different registries for different packages, use scope-specific registries (npm config set @myscope:registry=https://myownregist.ry/packages/). Different registries for different unscoped packages are not supported anymore.
http://blog.npmjs.org/post/161081169345/v500

Or at lease give users a cli option to override registry host in yarn.lock

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

Node.js version: 8.0.0
Yarn version: 0.24.6
NPM version: 5.0.1

You can also check this repo:
https://github.com/OpenGG/yarn-lock-resolved-override-registry

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions