yarn
yarn copied to clipboard
How to use yarn 1.22.19 instead of yarn 3.2.1?
I am trying to user yarn v1 but regardless of how I install it (npm, apt, deb) yarn -v shows me 3.2.1 in response of yarn -v.
yarn set version 1.22.19 does not help either. What should I do to use yarn 1.22.19?
corepack prepare [email protected] --activate
Afterwards yarn -v should show 1.22.19.
I relate here to corepack, the recommended way to install yarn.
https://yarnpkg.com/getting-started/install#nodejs-1610
Here you find documentation how to use different versions of something with corepack.
https://nodejs.org/dist/latest/docs/api/corepack.html#upgrading-the-global-versions
corepack prepare [email protected] --activateAfterwards
yarn -vshould show1.22.19.I relate here to
corepack, the recommended way to install yarn.https://yarnpkg.com/getting-started/install#nodejs-1610
Here you find documentation how to use different versions of something with
corepack. https://nodejs.org/dist/latest/docs/api/corepack.html#upgrading-the-global-versions
Did not work for me. yarn -v still shows 3.2.1 after these steps.
I was facing the same problem and I found this issue on the corepack repository that helped.
You most likely have a .yarnrc.yml file setting the yarnPath config which is getting used by the version you set in packageManager.
I had a .yarnrc.yml in my root directory that was overriding my yarn version even when I set it in an individual folder. I'm currently using yarn set version classic in the root folder to use the latest v1, but I'm not sure if it may be better to remove the .yarnrc.yml and just set it individually in each project...
corepack prepare [email protected] --activateAfterwards
yarn -vshould show1.22.19.I relate here to
corepack, the recommended way to install yarn.https://yarnpkg.com/getting-started/install#nodejs-1610
Here you find documentation how to use different versions of something with
corepack. https://nodejs.org/dist/latest/docs/api/corepack.html#upgrading-the-global-versions
For me, works this: yarn set version 1.22.1
yarn set version classicin the root folder to use the latest v1
This worked for me, thanks.
I had a
.yarnrc.ymlin my root directory that was overriding my yarn version even when I set it in an individual folder. I'm currently usingyarn set version classicin the root folder to use the latest v1, but I'm not sure if it may be better to remove the.yarnrc.ymland just set it individually in each project...
This was it for me, it was in my root user folder on my computer and cascaded all the way down to individual projects, so just keep doing cd .. && ls-la and search for that.
I was facing the same problem and I found this issue on the corepack repository that helped.
You most likely have a .yarnrc.yml file setting the yarnPath config which is getting used by the version you set in packageManager.
I had a
.yarnrc.ymlin my root directory that was overriding my yarn version even when I set it in an individual folder. I'm currently usingyarn set version classicin the root folder to use the latest v1, but I'm not sure if it may be better to remove the.yarnrc.ymland just set it individually in each project...
worked to me too.
also if you have used berry version to install node_modules and now want to move to classic and installing packages again then make sure to delete yarnrc.yml file.
I was facing the same issue. What I did. I deleted the .yarnrc.yml file globally from the windows. Then I just ran yarn install to install all the dependencies. It worked. Now the my yarn version is 1.22.19 which is stable.
My .yarnrc.yml file wasn't pointing to any specific yarn version but my package.json had a hardcoded packageManager": "[email protected]".
Lost half an hour trying to understand why the corepack prepare wasn't working...
I was installing & uninstalling yarn multiple times, but then I found that there was a .yarnrc.yml in my root folder, deleted the file and it's 1.22.19 finally..