yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.44k stars 2.73k forks source link

Doesn't work with github branches #671

Closed onlywei closed 8 years ago

onlywei commented 8 years ago

v0.15.1

Do you want to request a feature or report a bug? Feature? Bug? Not sure.

What is the current behavior? I just tried installing yarn today for a spin, and immediately failed when I tried to execute yarn in my directory because I have this dependency listed in my package.json: "istanbul": "gotwarlost/istanbul.git#source-map"

If the current behavior is a bug, please provide the steps to reproduce. Just try running yarn with that listed in as a dependency or devDependency in package.json

What is the expected behavior? Install?

Please mention your node.js, yarn and operating system version. Node v6.3.1, Yarn v0.15.1, Mac OS X 10.11.6

tabrindle commented 8 years ago

I'm having the same issue:

excerpt from the package.json

    "css-mqpacker": "^5.0.1",
    "eslint": "^3.4.0",
    "icon-font-generator": "git+https://github.com/tabrindle/icon-font-generator.git#feature/optional-font-types",
    "jasmine-core": "^2.5.1",

Throws this error:

info No lockfile found.
[1/4] 🔍  Resolving packages...
error Couldn't find match for "feature/optional-font-types" in "feature,master" for "https://github.com/tabrindle/icon-font-generator.git".
info Visit http://yarnpkg.com/en/docs/cli/install for documentation about this command.
andrewaustin commented 8 years ago

Same issue happens with other repository hosts, including bitbucket.

EDIT: This is a dupe of #513

milosivanovic commented 8 years ago

@onlywei it should work for your case if you follow https://github.com/yarnpkg/yarn/issues/708.

@tabrindle looks like in this specific case the slash is the culprit. If the branch has no / in it, it'll work. Nice find.

tabrindle commented 8 years ago

I believe the / issue is solved with https://github.com/yarnpkg/yarn/pull/813

jmonster commented 8 years ago

I'm having issues despite the proposed workarounds, but I did find that pointing at the tarball fixed my problem. In my package.json, the following pulls in what I expect:

"ember-sprite": "https://github.com/jmonster/ember-sprite/tarball/engines",

However, the following attempts all failed:

"ember-sprite": "ssh://github.com/jmonster/ember-sprite.git#engines",
"ember-sprite": "jmonster/ember-sprite#engines",
etc

To be specific, Yarn was able to clone the repo in the latter attempts -- but the code it used was not the correct branch. This was obvious because I kept getting either the following error:

error Couldn't find any versions for ember-sprite that matches ssh://git@github.com:jmonster/ember-sprite#engines. Possible versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.1.0, 0.2.1, 0.3.0, 0.3.1, 0.4.0, 0.5.0, 0.6.0, 0.7.0

or this one (which is what the branch engines fixed)

error ember-sprite@0.7.0: The engine "node" is incompatible with this module. Expected version "4.2.x".
error Found incompatible module
samccone commented 8 years ago

This has been fixed by a collection of fixed that have landed in master over the past 2 weeks. please reopen if you are still able to reproduce on master.

thanks everyone.