Corepack


稳定性: 1 - 实验性

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 会从网络下载最新版本。
  • 任何所需的更新(与安全漏洞或其他方面相关)都不在 Node.js 项目的范围内。如有必要,终端用户必须自行解决更新问题。

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

🌐 This feature simplifies two core workflows:

  • 它简化了新贡献者的入职流程,因为他们不再需要仅仅为了使用你希望他们使用的包管理器而遵循特定系统的安装步骤。
  • 它允许你确保团队中的每个人都将使用你希望他们使用的确切包管理器版本,而无需他们在每次你需要进行更新时手动同步。