# How do I use Yarn 3.4.1 with the node orb?

**URL:** <https://discuss.circleci.com/t/how-do-i-use-yarn-3-4-1-with-the-node-orb/47187>\
**Category:** Build Environment\
**Tags:** yarn\
**Created:** [February 22, 2023, 9:47pm UTC](https://discuss.circleci.com/t/how-do-i-use-yarn-3-4-1-with-the-node-orb/47187 "2023-02-22T21:47:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![nroose](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/nroose/32/18980_2.png) [@nroose](https://discuss.circleci.com/u/nroose)\
**Post date:** [February 22, 2023, 9:47pm UTC](https://discuss.circleci.com/t/how-do-i-use-yarn-3-4-1-with-the-node-orb/47187/1 "2023-02-22T21:47:24Z")

</div>

We are trying to update to using the latest version of yarn, instead of “classic” or version 1, which is no longer active )[GitHub - yarnpkg/yarn: The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry](https://github.com/yarnpkg/yarn#readme)). I get an error if I try to specify that version in the node spec. The docs seem all about installing the packages outside of our scripts. I want that in our scripts.

---

<div class="post-metadata">

**Author:** ![jerdog](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jerdog/32/32130_2.png) [@jerdog](https://discuss.circleci.com/u/jerdog)\
**Post date:** [February 23, 2023, 9:55am UTC](https://discuss.circleci.com/t/how-do-i-use-yarn-3-4-1-with-the-node-orb/47187/2 "2023-02-23T09:55:01Z")

</div>

Can you provide some more information as to what you’re experiencing? Like which Docs you’re reviewing, a copy of your config.yml file, error messages, etc? This will help in routing to a good answer.

---

<div class="post-metadata">

**Author:** ![nroose](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/nroose/32/18980_2.png) [@nroose](https://discuss.circleci.com/u/nroose)\
**Post date:** [February 24, 2023, 7:02pm UTC](https://discuss.circleci.com/t/how-do-i-use-yarn-3-4-1-with-the-node-orb/47187/3 "2023-02-24T19:02:24Z")

</div>

Well, so first, I tried

```auto
   - node/install:
        install-yarn: true
        yarn-version: 3.4.1
        node-version: '16.19.0'

```

And I got

```auto
Selected version of Yarn is 3.4.1
Checking if YARN is already installed...
Installing YARN v3.4.1
^@^@
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
mv: cannot stat 'yarn-v3.4.1/*': No such file or directory

```

And subsequent searches of the docs indicated that that mechanism only worked with yarn 1.  
Now I am doing a run block to install it:

```auto
    name: Yarn Set Version Stable                                                                                                                                   
    command: |                                                                                                                                                      
     npm install -g yarn || echo "Yarn may have already been installed."                                                                                            
     yarn set version stable                                                                                                                                        

```

but not sure if that is the best way.

---

<div class="post-metadata">

**Author:** ![jerdog](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jerdog/32/32130_2.png) [@jerdog](https://discuss.circleci.com/u/jerdog)\
**Post date:** [February 27, 2023, 2:31pm UTC](https://discuss.circleci.com/t/how-do-i-use-yarn-3-4-1-with-the-node-orb/47187/4 "2023-02-27T14:31:17Z")

</div>

Thank you - I have pinged this to the team to see what’s up

---

<div class="post-metadata">

**Author:** ![KyleTryon](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/kyletryon/32/9977_2.png) [@KyleTryon](https://discuss.circleci.com/u/KyleTryon)\
**Post date:** [February 27, 2023, 2:39pm UTC](https://discuss.circleci.com/t/how-do-i-use-yarn-3-4-1-with-the-node-orb/47187/5 "2023-02-27T14:39:06Z")

</div>

Thanks for sharing @nroose. BAsed on the information you provided, it seems like we could possibly drop Yarn 1 in future major versions of the Node orb, does that seem acceptable to you?

For a workaround, what you are showing there is actually more or less exactly what we would change to the orb as well. I believe we originally were pulling from GitHub releases to ensure a version number, but that is subject to change and cause issues like you saw here, installing via NPM may be more reliable as it self-installs.

---

<div class="post-metadata">

**Author:** ![nroose](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/nroose/32/18980_2.png) [@nroose](https://discuss.circleci.com/u/nroose)\
**Post date:** [February 27, 2023, 5:35pm UTC](https://discuss.circleci.com/t/how-do-i-use-yarn-3-4-1-with-the-node-orb/47187/6 "2023-02-27T17:35:04Z")

</div>

So, uh, we are actually struggling now with the upgrade. I am a little ahead of the team in figuring out how to do it on CircleCI. I think a lot of yarn users are still on the old one, unfortunately. And I think the benefits of yarn are no longer that much better than NPM anyway, so we may just go back to npm. In the end, I think supporting 1 and 3 would be great. I guess 2 didn’t last long, so not sure about that one.

---

<div class="post-metadata">

**Author:** ![nroose](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/nroose/32/18980_2.png) [@nroose](https://discuss.circleci.com/u/nroose)\
**Post date:** [February 27, 2023, 9:56pm UTC](https://discuss.circleci.com/t/how-do-i-use-yarn-3-4-1-with-the-node-orb/47187/7 "2023-02-27T21:56:19Z")

</div>

Uh, did you change something? We are getting errors on the old version now.

---

<div class="post-metadata">

**Author:** ![nroose](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/nroose/32/18980_2.png) [@nroose](https://discuss.circleci.com/u/nroose)\
**Post date:** [February 27, 2023, 10:04pm UTC](https://discuss.circleci.com/t/how-do-i-use-yarn-3-4-1-with-the-node-orb/47187/8 "2023-02-27T22:04:14Z")

</div>

Oh, now it’s working!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [March 6, 2023, 10:04pm UTC](https://discuss.circleci.com/t/how-do-i-use-yarn-3-4-1-with-the-node-orb/47187/9 "2023-03-06T22:04:32Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
