question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug?]: YN0001: UsageError: No ancestor could be found between any of HEAD and master, origin/master, upstream/master, main, origin/main, upstream/main

See original GitHub issue

Self-service

  • I’d be willing to implement a fix

Describe the bug

I read a docs about yarn version and installed module via command yarn plugin import version and run yarn version check command. In each run I get a error.

To reproduce

yarn plugin import version
yarn version check

Environment

System:
  OS: Windows 10 10.0.19044
  CPU: (12) x64 AMD Ryzen 5 4600H with Radeon Graphics
Binaries:
  Node: 16.13.2 - ~\AppData\Local\Temp\xfs-e9b3eefb\node.CMD
  Yarn: 3.2.0 - ~\AppData\Local\Temp\xfs-e9b3eefb\yarn.CMD
  npm: 8.1.2 - A:\NodeJS\npm.CMD

.yarnrc.yml

plugins:
  - path: .yarn/plugins/@yarnpkg/plugin-version.cjs
    spec: "@yarnpkg/plugin-version"

yarnPath: .yarn/releases/yarn-3.2.0.cjs
nodeLinker: node-modules

Additional context

YN0001: UsageError: No ancestor could be found between any of HEAD and master, origin/master, upstream/master, main, origin/main, upstream/main at Object.wAe ($root_.node\corepack\yarn\3.2.0\yarn.js:595:7874) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async $v ($root.yarn\plugins@yarnpkg\plugin-version.cjs:433:8625) at async $root.yarn\plugins@yarnpkg\plugin-version.cjs:446:10281 at async Function.start ($root_.node\corepack\yarn\3.2.0\yarn.js:413:2373) at async t_.executeStandard ($root.yarn\plugins@yarnpkg\plugin-version.cjs:446:10192) at async t_.execute ($root.yarn\plugins@yarnpkg\plugin-version.cjs:446:3414) at async t_.validateAndExecute ($root_.node\corepack\yarn\3.2.0\yarn.js:349:673) at async Is.run ($root_.node\corepack\yarn\3.2.0\yarn.js:363:2087) at async Is.runExit ($root_.node\corepack\yarn\3.2.0\yarn.js:363:2271)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
MarZabcommented, Jul 11, 2022

Figured out the issue - as it says in the error it could not find any of “master, origin/master, upstream/master, main, origin/main, upstream/main” branches.

I think this issue stems from the fact that the legacy tool only updated the version while the yarn 2 plugin does a lot more.

npm still retains the old behaviour so the solution could be this:

npm version patch --no-git-tag-version
0reactions
jacobraskcommented, Oct 5, 2022

Unfortunately npm version doesn’t work if you have any workspace dependencies. And yarn version makes a lot of assumptions when we just want to change version in a json file programmatically.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Yarn 2: `yarn version check` during CI always errors
It will take longer, but it seems that this command needs that across multiple branches and tags. - name: Checkout uses: actions/checkout@v2 ...
Read more >
Configuration options | Yarn - Package Manager
While Yarn will automatically find them in the parent directories, ... against master, origin/master, upstream/master, main, origin/main, and upstream/main.
Read more >
Fix Git's "fatal: no upstream branch" error quickly example
Here's a quick fix for Git's "fatal: The current branch has no upstream branch" error, along with a brief explanation of why this...
Read more >
bitbake fatal: branch origin/master does not exist
Solved: After I hit a dead end on the windows side ( related post ) I thought I'd try building a linux image...
Read more >
Git Fixes: The Current Branch Has No Upstream Branch
You create a new branch, make some commits and then after doing git ... Find Your Bootcamp Match ... git push --set-upstream origin...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found