[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 issueSelf-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:
- Created a year ago
- Comments:5 (1 by maintainers)
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:Unfortunately
npm version
doesn’t work if you have anyworkspace
dependencies. Andyarn version
makes a lot of assumptions when we just want to changeversion
in a json file programmatically.