How to upgrade yarn version using terminal?

后端 未结 14 2251
一生所求
一生所求 2021-01-30 05:03

How should yarn be upgraded to the latest version?

14条回答
  •  说谎
    说谎 (楼主)
    2021-01-30 05:10

    I tried all of the above solutions in Jenkins pipeline which needs the latest yarn. Finally, this worked for me.

    1. Run yarn policies set-version in the git repo
    2. This will generate .yarn/releases/yarn-X.X.X.js file and .yarnrc file. Push both of these files in the Git repo.
    3. Now build and all the yarn commands will use the yarn-X.X.X version.

    Note: This is helpful when you don't have root access to npm install -g yarn.

提交回复
热议问题