升级全局版本
当在现有项目之外运行时(例如运行 yarn init
时),Corepack 将默认使用与每个工具的最新稳定版本大致对应的预定义版本。
可以通过运行 corepack prepare
命令以及您希望设置的包管理器版本来覆盖这些版本:
corepack prepare yarn@x.y.z --activate
When running outside of an existing project (for example when running
yarn init
), Corepack will by default use predefined versions roughly
corresponding to the latest stable releases from each tool. Those versions can
be overridden by running the corepack prepare
command along with the
package manager version you wish to set:
corepack prepare yarn@x.y.z --activate