{"record":{"id":"d95d2944174f019a","repo":"yarnpkg/yarn","slug":"couldntfindmatch","errorCode":null,"errorMessage":"couldntFindMatch","messagePattern":"couldntFindMatch","errorType":"exception","errorClass":"MessageError","httpStatus":null,"severity":"error","filePath":"src/util/git.js","lineNumber":502,"sourceCode":"  }\n\n  /**\n   * Resolves the input hash / ref / semver range to a valid commit sha\n   * If possible also resolves the sha to a valid ref in order to use \"git archive\"\n   */\n\n  async setRef(refs: GitRefs): Promise<string> {\n    // get commit ref\n    const {hash: version} = this;\n\n    const resolvedResult = await resolveVersion({\n      config: this.config,\n      git: this,\n      version,\n      refs,\n    });\n    if (!resolvedResult) {\n      throw new MessageError(\n        this.reporter.lang('couldntFindMatch', version, Array.from(refs.keys()).join(','), this.gitUrl.repository),\n      );\n    }\n\n    this.hash = resolvedResult.sha;\n    this.ref = resolvedResult.ref || '';\n    return this.hash;\n  }\n}\n","sourceCodeStart":484,"sourceCodeEnd":512,"githubUrl":"https://github.com/yarnpkg/yarn/blob/c2dda503f3759b5be5f0e24ecd9cf5c97a540147/src/util/git.js#L484-L512","documentation":"Error \"couldntFindMatch\" thrown in yarnpkg/yarn.","triggerScenarios":"Yarn cannot find a git ref, branch, or tag matching the requested commit-ish in src/util/git.js.","commonSituations":"Occurs when a package.json git dependency references a non-existent branch, tag, or commit, or the remote no longer advertises the ref.","solutions":["The requested commit, tag, branch, or semver range could not be resolved to any ref in the git repository. Check the fragment after the # in the dependency URL for typos.","Run `git ls-remote <repo-url>` and pick one of the listed refs or a valid 40-char commit sha, then update package.json.","If the commit exists locally but not on the remote, push it to the remote repository first."],"exampleFix":"git ls-remote https://github.com/user/repo.git | grep <ref>  # then fix the #<ref> in package.json","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c2dda503f3759b5be5f0e24ecd9cf5c97a540147","analyzedAt":"2026-08-13T04:17:06.305Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}