yarn icon indicating copy to clipboard operation
yarn copied to clipboard

How to use yarn 1.22.19 instead of yarn 3.2.1?

Open zgordan-vv opened this issue 3 years ago • 13 comments

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?

zgordan-vv avatar Jun 25 '22 07:06 zgordan-vv

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

gestj avatar Jul 01 '22 10:07 gestj

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

Did not work for me. yarn -v still shows 3.2.1 after these steps.

paulz-swyftx avatar Jul 19 '22 02:07 paulz-swyftx

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...

saifahn avatar Aug 11 '22 02:08 saifahn

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

For me, works this: yarn set version 1.22.1

yersel500 avatar Aug 27 '22 05:08 yersel500

yarn set version classic in the root folder to use the latest v1

This worked for me, thanks.

theWiseAman avatar Dec 15 '22 14:12 theWiseAman

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...

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.

beardsleym avatar Mar 07 '23 20:03 beardsleym

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...

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.

theabhayprajapati avatar Jul 03 '23 19:07 theabhayprajapati

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.

Protik111 avatar Aug 06 '23 13:08 Protik111

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...

tbunique avatar Aug 09 '23 14:08 tbunique

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..

beku8 avatar Sep 22 '23 01:09 beku8