Corepack


稳定性: 1 - 实验性的

¥Stability: 1 - Experimental

Corepack 是一个实验性工具,可帮助管理包管理器的版本。它为每个 支持的包管理器 公开二进制代理,在调用时,将识别为当前项目配置的任何包管理器,根据需要下载它,最后运行它。

¥*Corepack* is an experimental tool to help with managing versions of your package managers. It exposes binary proxies for each supported package manager that, when called, will identify whatever package manager is configured for the current project, download it if needed, and finally run it.

尽管 Corepack 是随 Node.js 的默认安装一起分发的,但由 Corepack 管理的包管理器并不是 Node.js 分发版的一部分,并且:

¥Despite Corepack being distributed with default installs of Node.js, the package managers managed by Corepack are not part of the Node.js distribution and:

  • 首次使用时,Corepack 会从网络下载最新版本。

    ¥Upon first use, Corepack downloads the latest version from the network.

  • 任何所需的更新(与安全漏洞或其他相关)都超出了 Node.js 项目的范围。如有必要,终端用户必须自行弄清楚如何更新。

    ¥Any required updates (related to security vulnerabilities or otherwise) are out of scope of the Node.js project. If necessary end users must figure out how to update on their own.

此特性简化了两个核心工作流程:

¥This feature simplifies two core workflows:

  • 它简化了新贡献者的加入,因为他们不必再遵循特定于系统的安装过程,只需拥有你想要的包管理器。

    ¥It eases new contributor onboarding, since they won't have to follow system-specific installation processes anymore just to have the package manager you want them to.

  • 它允许你确保团队中的每个人都将使用你想要的包管理器版本,而无需他们在每次需要进行更新时手动同步它。

    ¥It allows you to ensure that everyone in your team will use exactly the package manager version you intend them to, without them having to manually synchronize it each time you need to make an update.