yarnpkg/yarn

False resolutions entry for bower-components

Open

#5161 opened on Jan 6, 2018

View on GitHub
 (1 comment) (0 reactions) (1 assignee)JavaScript (41,514 stars) (2,731 forks)batch import
cat-buggood first issuehelp wantedtriaged

Description

Do you want to request a feature or report a bug? Bug What is the current behavior? If I run yarn install --flat and there is a version conflict for a private bower-component, the value of the resultions entry, which will be added by yarn, is wrong. Yarn just adds the version number to the resolutions entry, but it should contains the hole URL plus the version which should be installed.

If the current behavior is a bug, please provide the steps to reproduce. For example, I have the following package.json

{
    .
    .
    .
    "dependencies": {
        "@bower_components/myPrivatePackage1": "<url to my gitlab>#2.6.0",
        "@bower_components/myPrivatePackage2": "<url to my gitlab>#1.0.0"
    }
}

There is a version conflict for myPrivatePackage1 (myPrivatePackage2 referes myPrivatePackage1#2.5.0, and I wan't to install v2.5.0 instead of v2.6.0). For this purpose I run yarn install --flat to specify the version which should be installed, in that case I choose v2.5.0. Yarn than append the following resolutions entry to my package.json

{
    .
    .
    .
    "resolutions": {
        "@bower_components/myPrivatePackage1": "2.5.0"
    }
}

What is the expected behavior? The resolutions entry should contain the complete URL of the package like that:

{
    .
    .
    .
    "resolutions": {
        "@bower_components/myPrivatePackage1": "<url to my gitlab>#2.5.0"
    }
}

Please mention your node.js, yarn and operating system version. Node: v8.9.1 Yarn: 1.3.2

Contributor guide