javascript技巧

关注公众号 jb51net

关闭
首页 > 网络编程 > JavaScript > javascript技巧 > pnpm install ERR

pnpm install:ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies

作者:天問

这篇文章主要为大家介绍了pnpm install:ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies报错解决

引言

使用 pnpm install 安装项目依赖时出现:ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies,在 pnpm github issues 中找到相关解决方案。

pnpm && npm

一、前言

ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies
.
└─┬ koa-views
  └─┬ consolidate
    └── ✕ unmet peer react@^16.13.1: found 18.1.0
hint: If you don't want pnpm to fail on peer dependency issues, set the "strict-peer-dependencies" setting to "false".

There are two types of peer deps: optional peer dependencies and non-optional ones. The warnings are only printed for non-optional peer dependencies. If a package works without the peer dependencies, then it should be declared as optional peer dependency. Optional peer dependencies are supported by npm/yarn/pnpm for a long time.

二、处理方案

{
  "pnpm": {
    "peerDependencyRules": {
      "ignoreMissing": [
        "react"
      ]
    }
  }
}
npm config set strict-peer-dependencies=false

参考链接:https://github.com/pnpm/pnpm/issues/4684

以上就是pnpm install:ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies的详细内容,更多关于pnpm install ERR的资料请关注脚本之家其它相关文章!

您可能感兴趣的文章:
阅读全文