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


当前回答

对于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

其他回答

因为你已经安装了yarn,只想升级/更新。你可以简单地使用 纱的由来 请在这里找到参考资料https://yarnpkg.com/en/docs/cli/self-update

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

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

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

NPM install -g yarn -解决了运行NPM update -global yarn时什么都没有发生的问题。

更新纱线的替代方法:curl——compressed -o- l https://yarnpkg.com/install.sh | bash。

使用自制程序的Mac用户可以运行brew upgrade yarn。

更多细节在这里和这里。

如果你已经有纱线了。X,你想升级到yarn 2。你需要做一些不同的事情:

yarn set version berry

其中berry是yarn版本2的代码名。更多信息请参见此处的迁移指南。

对于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