跳到主内容

pnpm 10.15

· 一分钟阅读
Zoltan Kochan
pnpm 的首席维护者

Minor Changes

New setting for catalogs

Added the cleanupUnusedCatalogs configuration. When set to true, pnpm will remove unused catalog entries during installation #9793.

Config dependency improvement

pnpm will now automatically load pnpmfiles from config dependencies that are named @*/pnpm-plugin-* #9780.

Changes to the config get/set commands

  • pnpm config get now prints an INI string for an object value #9797.

  • pnpm config get now accepts property paths.

    示例:

    pnpm config get catalog.react
    pnpm config get .catalog.react
    pnpm config get 'packageExtensions["@babel/parser"].peerDependencies["@babel/types"]'

    pnpm config set now accepts dot-leading or subscripted keys.

    示例:

    pnpm config set .ignoreScripts true
  • pnpm config get --json now prints a JSON serialization of config value, and pnpm config set --json now parses the input value as JSON.

Patch Changes

  • Semi-breaking. When automatically installing missing peer dependencies, prefer versions that are already present in the direct dependencies of the root workspace package #9835.
  • When executing the pnpm create command, must verify whether the node version is supported even if a cache already exists #9775.
  • When making requests for the non-abbreviated packument, add */* to the Accept header to avoid getting a 406 error on AWS CodeArtifact #9862.
  • The standalone exe version of pnpm works with glibc 2.26 again #9734.
  • Fix a regression in which pnpm dlx pkg --help doesn't pass --help to pkg #9823.

pnpm 10.14

· 一分钟阅读
Zoltan Kochan
pnpm 的首席维护者

增加了对 JavaScript 运行时安装的支持

devEngines.runtime (在 package.json中) 中声明Node.js, Deno 或 Bun ,并让pnpm 自动下载并固定它。

用法示例:

{
"devEngines": {
"runtime": {
"name": "node",
"version": "^24.4.0",
"onFail": "download" // we only support the "download" value for now
}
}
}

工作原理:

  1. pnpm install 将您指定的范围解析为最新的匹配运行时版本。
  2. 精确的版本(和校验和)保存在锁文件(lockfile)中。
  3. 脚本使用本地运行时,确保跨环境的一致性。

为什么这样更好:

  1. 此新设置也支持 Deno 和 Bun(vs 仅支持 Node 的设置“useNodeVersion”和“executionEnv.nodeVersion”)
  2. 支持版本范围(不仅仅是固定版本)。
  3. 解析后的版本与完整性校验和一起存储在 pnpm 锁文件中,以便将来验证 Node.js 内容的有效性。
  4. 它可以在任何工作区项目上使用 (就像 executionEnv.nodeVersion)。 因此,工作区中的不同项目可以使用不同的运行时。
  5. 目前,“devEngines.runtime”设置将在本地安装运行时,我们将在 pnpm 的未来版本中通过在计算机上使用共享位置来改进它。

相关 PR: #9755

其他新功能

  • Added --cpu, --libc, and --os to pnpm install, pnpm add, and pnpm dlx to customize supportedArchitectures via the CLI #7510.

Bug 修复

  • Fix a bug in which pnpm add downloads packages whose libc differ from pnpm.supportedArchitectures.libc.
  • The integrities of the downloaded Node.js artifacts are verified #9750.
  • Allow dlx to parse CLI flags and options between the dlx command and the command to run or between the dlx command and -- #9719.
  • pnpm install --prod should removing hoisted dev dependencies #9782.
  • Fix an edge case bug causing local tarballs to not re-link into the virtual store. This bug would happen when changing the contents of the tarball without renaming the file and running a filtered install.
  • Fix a bug causing pnpm install to incorrectly assume the lockfile is up to date after changing a local tarball that has peers dependencies.

pnpm 的 2022 年

· 一分钟阅读
Zoltan Kochan
pnpm 的首席维护者

又是一年年底。 真是艰难的一年。 你们应该知道,我住在乌克兰,由于俄罗斯对我们发动战争,指挥这个项目比往年都难。 尽管如此,今年对pnpm来说是很好的一年。 我们有了很多新用户、贡献者,并且我们实现了许多很棒的功能。

(上图由 Midjourney 生成。 这只老虎象征虎年)

pnpm 的 2021 年

· 一分钟阅读
Zoltan Kochan
pnpm 的首席维护者

现在是年底,对 pnpm 来说是个好年头,所以让我们看看它的进展情况。

pnpm的node_modules配置选项

· 一分钟阅读
Zoltan Kochan
pnpm 的首席维护者

创建node_modules目录结构有多种方式。 你一定想要创建最严格的结构,当然如果你当前的项目尚无法支持,你可以配置为不严格的。

平铺的结构不是 node_modules 的唯一实现方式

· 一分钟阅读
Zoltan Kochan
pnpm 的首席维护者

Pnpm 的新用户们经常会问我关于 pnpm 创建的奇怪的 node_modules 结构。 为什么不是平铺的? 次级依赖去哪了?