berry: [Bug] `yarn set version berry` writes absolute (non-portable) path into .yarnrc.yml
- I’d be willing to implement a fix
Describe the bug
yarn set version berry
writes a .yarnrc.yml
with an absolute path for yarnPath
. I assume this is a bug since the .yarnrc.yml
and .yarn/releases
are meant to be portable and local.
To Reproduce
I created a reproduction with Github Actions that can also be copy-pasted to run locally. https://github.com/cspotcode/repros/tree/yarnrc-absolute-yarnPath
Environment if relevant (please complete the following information):
- OS: Ubuntu
- Node version v12.15.0
- Yarn version 2.0.0-rc.28
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 19
- Comments: 16 (3 by maintainers)
Same –
yarn set version berry
yarn set version berry
It seems like the work around is to run
yarn set version berry
twice in a row, until they update the global yarn install version.A fix seems to have been merged into the 1.x repo: https://github.com/yarnpkg/yarn/pull/7931
Some observation from my side. Recently i ditched Yarn 1 & friends from system and set up clean Yarn 2 Berry. The only Yarn on my Linux system. Created some project and it had
yarnPath: .yarn/releases/yarn-rc.js
Today i decided to convert my WebPack configs in TS which led me again to Yarn’s documentation which says that they move to Per-Project installation workflow which sounds reasonable to me. So i ditched again my Yarn 2, Node, Npm & frieds (simply to have clean setup). Installed Yarn 1.23 as per instructions. + Node 13.9.0, Npm 6.13.7 Now, when i doyarn set version berry
is see.yarnrc.yml
created but with contentyarnPath: "/home/dzintars/Code/yarn-test/.yarn/releases/yarn-berry.js"
Other thing is… as soon as i enable
"type": "module",
inpackage.json
Yarn Berry fails to execute evenyarn --version
with:So… it looks to me that there are some issues with 2 versions installed on the system.