How to upgrade yarn version using terminal?

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

How should yarn be upgraded to the latest version?

相关标签:
14条回答
  • 2021-01-30 05:22
    npm install --global yarn
    npm upgrade --global yarn 
    

    This should work.

    0 讨论(0)
  • 2021-01-30 05:24

    npm install -g yarn - solved the issue when nothing happened running npm update --global yarn.

    Alternative method to update yarn: curl --compressed -o- -L https://yarnpkg.com/install.sh | bash.

    Mac users with homebrew can run brew upgrade yarn.

    More details here and here.

    0 讨论(0)
  • 2021-01-30 05:25

    If you already have yarn 1.x and you want to upgrade to yarn 2. You need to do something a bit different:

    yarn set version berry
    

    Where berry is the code name for yarn version 2. See this migration guide here for more info.

    0 讨论(0)
  • 2021-01-30 05:27

    For macOS users, if you installed yarn via brew, you can upgrade it using the below command:

    brew upgrade yarn

    0 讨论(0)
  • 2021-01-30 05:30
    1. Add Yarn Package Directory:

    curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

    1. Install Yarn:

    sudo apt-get update && sudo apt-get install yarn

    Please note that the last command will upgrade yarn to latest version if package already installed.

    For more info you can check the docs: yarn installation

    0 讨论(0)
  • 2021-01-30 05:31

    I updated yarn on my Ubuntu by running the following command from my terminal

    curl --compressed -o- -L https://yarnpkg.com/install.sh | bash

    source:https://yarnpkg.com/lang/en/docs/cli/self-update

    0 讨论(0)
提交回复
热议问题