Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: specify yarn package manager version #623

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

A-kirami
Copy link
Contributor

概述

更新了 package.json 文件,明确指定了 Yarn 包管理器的版本,以确保项目中的依赖管理保持一致。

为什么

Yarn 官方不推荐全局安装,在它们的官方文档中可以看到以下理由:

You may notice by reading our installation guide that we don't tell you to run npm install -g yarn to install Yarn - we even recommend against it. The reason is simple: just like your project dependencies must be locked, so should be the package manager itself.

Installing Yarn as a global binary meant you always used whatever was the latest version published. Most of the time it worked fine, but every once in a while something was shipped that could impact the way your project was installed - be it a bugfix, new bug, or breaking change.

通过指定 packageManager,可以使用 Corepack 按项目安装所需的包管理器版本。

此举还可以避免本地开发时多个 Yarn 版本冲突问题。

@MakinoharaShoko MakinoharaShoko merged commit 9d84d06 into OpenWebGAL:dev Jan 9, 2025
1 check passed
@A-kirami A-kirami deleted the yarn-package-manager branch January 14, 2025 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants