yarn icon indicating copy to clipboard operation
yarn copied to clipboard

Yarn couldnt find match for specific commit in "_c"

Open EugeneHlushko opened this issue 8 years ago • 20 comments

Do you want to request a feature or report a bug?

Bug

What is the current behavior? In package.json: "backbone": "git+https://github.com/jashkenas/backbone#6a82b0c897c97bbfb8c5f9cb6b5516feb8d3c778",

running yarn:

yarn install v1.0.1
[1/4] Resolving packages...
[2/4] Fetching packages...
error Couldn't find match for "6a82b0c897c97bbfb8c5f9cb6b5516feb8d3c778" in "_c" for "https://github.com/jashkenas/backbone".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

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

add the listed above dependency to your package json "dependencies" field and run yarn install also make sure yarn cache is clean if is not reproducible

What is the expected behavior? yarn would install dep with commit hash reference. The commit exists and accesibble: https://github.com/jashkenas/backbone/commit/6a82b0c897c97bbfb8c5f9cb6b5516feb8d3c778

It was working on yarn 0.27.3

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

centos 6.9.0
nodejs: 8.2.0
yarn: 1.0.1

EugeneHlushko avatar Sep 15 '17 08:09 EugeneHlushko

Weird (maybe someone can explain this?) but this issue went away when I removed this line from my ./ssh/config: UserKnownHostsFile /dev/null

mkj28 avatar Sep 21 '17 23:09 mkj28

I dont see direct connection, but first need to glance at code in yarnpkg

EugeneHlushko avatar Sep 22 '17 18:09 EugeneHlushko

Any known workarounds? We can't use yarn on our Ubuntu build server right now due to this bug.

:man_facepalming: my bad, looks like it was a reference to a non-existent commit in the package.json. Leaving the comment here in case it helps someone.

alexmiddeleer avatar Oct 13 '17 14:10 alexmiddeleer

try yarn cache clean

Argun avatar Oct 16 '17 03:10 Argun

I can't believe such essential thing is broken for what's possibly months. Installing the last pre-v1 yarn version works: https://github.com/yarnpkg/yarn/releases/tag/v0.28.4

jankalfus avatar Nov 02 '17 16:11 jankalfus

😬 I too cannot believe this has been broken for so long ... I use this functionality all the time and just upgrade yarn to find it broken.

workmanw avatar Nov 03 '17 00:11 workmanw

wow its still here, maybe we really could look at it this weekend :)

EugeneHlushko avatar Nov 03 '17 15:11 EugeneHlushko

This could really use a nicer error message :)

For me it was specifying a git commit I had not pushed yet... 🤦‍♂️

agibralter avatar Dec 18 '17 16:12 agibralter

still experiencing this issue

gwake1 avatar Jan 20 '18 00:01 gwake1

Solution which worked for me: I cleaned the cache yarn cache clean & then removed the dependency from package.json, and rerun yarn add[package].

yairopro avatar Feb 08 '18 17:02 yairopro

Make sure your version of Git is up to date. This fixed the problem for me. (a little more detail: Also tagging the commits in older version of Git seemed to fix the problem as well -- even if you don't reference it by that tag. I think that Yarn might not be getting the full list of commit hashes from old Git versions)

goodrichj avatar Feb 27 '18 00:02 goodrichj

I replicated this by removing a tag, and retagging a different commit. The old commit hash was in the yarn.lock file, so the cache clean was not relevant.

I re-generated the yarn.lock file to fix this, but I am working on a very small project, so removing and re-adding is a better approach.

plumpNation avatar Mar 08 '18 13:03 plumpNation

Is this a bug or a feature? Perhaps by design to lock to the latest commit of a branch when building?

adjavaherian avatar Mar 12 '18 18:03 adjavaherian

Here's what I had to do:

yarn cache clean
rm yarn.lock
yarn install

(installation succeeded but the build failed because of version trouble)

git checkout -- yarn.lock
rm -rf node_modules
yarn install

Now I can install the packages from the original lockfile... something I couldn't do just a moment ago!

It was a little confusing.

micahscopes avatar May 17 '18 19:05 micahscopes

@micahscopes unfortunately it doesn't work for me

Beraliv avatar Aug 28 '18 16:08 Beraliv

I have pretty the same problem. In package.json: "my-package": "git+http://10.1.1.1:4222/frontend/components.git#7d92hd7n3hd"

> yarn
yarn install v1.13.0
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error Couldn't find match for "7d92hd7n3hd7c095eece942cdd647fb7ace33d3c" in "refs/heads/FEATURE-1, refs/heads/FEATURE-2, refs/tags/v0.0.1, refs/tags/v0.0.2" for "git+http://10.1.1.1:4222/frontend/components.git#7d92hd7n3hd"
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

or this (on another mac):

> yarn install                                                                                      1 ↵
yarn install v1.13.0
[1/4] 🔍  Resolving packages...
error Command failed.
Exit code: 1
Command: git
Arguments: fetch --tags
Directory: /Users/yekver/Library/Caches/Yarn/v4/.tmp/7d92hd7n3hd7c095eece942cdd647fb7ace33d3c
Output:
From http://10.1.1.1:4222/frontend/components
 ! [rejected]        v0.0.1    -> v0.0.1  (would clobber existing tag)
 ! [rejected]        v0.0.2    -> v0.0.2  (would clobber existing tag)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Problem has gone after: yarn cache clean

OS: macOS 10.14.2 Node.js: 11.6.0

yekver avatar Jan 17 '19 12:01 yekver

npm config set proxy http://username:password@host:port npm config set https-proxy http://username:password@host:port

yarn config set proxy http://username:password@host:port yarn config set https-proxy http://username:password@host:port

git config --global http.proxy http://username:password@host:port git config --global https.proxy http://username:password@host:port

mhamdizo avatar Feb 13 '19 20:02 mhamdizo

My problem was my yarn.lock was referring to a commit that no longer existed (because it was on a branch that had been rebased). I ran yarn add my-package#branch and it pulled in the right commit hash.

benlind avatar Apr 01 '19 18:04 benlind

FWIW, and maybe this is a bad idea, I simply manually updated my yarn.lock file with the correct git hash under resolved of the dependency.

hayesgm avatar Jun 23 '20 05:06 hayesgm

clean yarn cache

yarn cache clean

delete yarn.lock and node_modules

AuroPick avatar May 10 '22 10:05 AuroPick