纱线应该如何升级到最新版本?


当前回答

我在我的终端上运行以下命令更新了我的Ubuntu上的yarn

curl——压缩-o- l https://yarnpkg.com/install.sh | bash

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

其他回答

npm install --global yarn
npm upgrade --global yarn 

这应该有用。

我一开始试过

yarn policies set-version

然后它指引我跑

yarn set version stable

您应该按顺序执行它们,第一个命令将下载您当前的yarn版本并更新.yarnrc,然后运行第二个命令将成功地将yarn升级到最新的稳定版本

我在我的终端上运行以下命令更新了我的Ubuntu上的yarn

curl——压缩-o- l https://yarnpkg.com/install.sh | bash

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

根据https://yarnpkg.com/getting-started/install#updating-to-the-latest-versions

yarn set version <version>

例如,将yarn v1.22.4升级到v1.22.10:

yarn set version 1.22.10

对于macOS用户,如果您通过brew安装了yarn,您可以使用以下命令升级它:

brew upgrade yarn

在Linux操作系统上,只需在终端上运行以下命令:

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

在Windows上,升级到Chocolatey

choco upgrade yarn

学分: 在以下答案的帮助下增加了答案

https://stackoverflow.com/a/54147594/842607 https://stackoverflow.com/a/53710422/842607