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


当前回答

这个工作为我改变纱线版本0.32 git到1.22.5

https://www.codegrepper.com/code-examples/shell/yarn+0.32+git+ubuntu

其他回答

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

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

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

Yarn策略集

是否下载最新的稳定版本

参考yarn文档 https://yarnpkg.com/lang/en/docs/cli/policies/#toc-policies-set-version

如果你已经有纱线了。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

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

这应该有用。