跳到主内容
版本:9.x

错误码

ERR_PNPM_UNEXPECTED_STORE

存在模块目录并链接到不同的存储目录。

If you changed the store directory intentionally, run pnpm install and pnpm will reinstall the dependencies using the new store.

ERR_PNPM_NO_MATCHING_VERSION_INSIDE_WORKSPACE

项目具有工作区中不存在的工作区依赖项。

For instance, package foo has bar@1.0.0 in the dependencies:

{
"name": "foo",
"version": "1.0.0",
"dependencies": {
"bar": "workspace:1.0.0"
}
}

However, there is only bar@2.0.0 in the workspace, so pnpm install will fail.

To fix this error, all dependencies that use the workspace protocol should be updated to use versions of packages that are present in the workspace. This can be done either manually or using the pnpm -r update command.

ERR_PNPM_PEER_DEP_ISSUES

pnpm install will fail if the project has unresolved peer dependencies or the peer dependencies are not matching the wanted ranges. 要解决此问题,请安装缺少的对等依赖项。

You may also selectively ignore these errors using the pnpm.peerDependencyRules.ignoreMissing and pnpm.peerDependencyRules.allowedVersions fields in package.json.

ERR_PNPM_OUTDATED_LOCKFILE

如果不更改 lockfile 就无法执行安装,则会发生此错误。 This might happen in a CI environment if someone has changed a package.json file in the repository without running pnpm install afterwards. 或者有人忘记提交 lockfile 文件的更改。

To fix this error, just run pnpm install and commit the changes to the lockfile.

ERR_PNPM_TARBALL_INTEGRITY

此错误表示下载的软件包的 tarball 与预期的完整性校验和不匹配。

If you use the npm registry (registry.npmjs.org), then this probably means that the integrity in your lockfile is incorrect. 如果 lockfile 解析时存在错误合并冲突,则可能会发生这种情况。

如果使用允许覆盖包的现有版本的注册表,则可能意味着在本地元数据缓存中有旧版本软件包的完整性校验和。 In this case, you should run pnpm store prune. 此命令将删除您的本地元数据缓存。 然后您可以重试失败的命令。

但是也要小心并验证软件包是否从正确的 URL 下载。 错误消息中应该打印 URL。

ERR_PNPM_MISMATCHED_RELEASE_CHANNEL

The config field use-node-version defines a release channel different from version suffix.

示例:

  • rc/20.0.0 defines an rc channel but the version is that of a stable release.
  • release/20.0.0-rc.0 defines a release channel but the version is that of an RC release.

要修复此错误,请删除发布通道前缀或更正版本后缀。

ERR_PNPM_INVALID_NODE_VERSION

The value of config field use-node-version has an invalid syntax.

Below are the valid forms of use-node-version:

  • 稳定版
    • X.Y.Z (X, Y, Z are integers)
    • release/X.Y.Z (X, Y, Z are integers)
  • RC 版本:
    • X.Y.Z-rc.W (X, Y, Z, W are integers)
    • rc/X.Y.Z-rc.W (X, Y, Z, W are integers)