欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

pnpm install:ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies

 更新時(shí)間:2023年06月14日 11:23:10   作者:天問  
這篇文章主要為大家介紹了pnpm install:ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies報(bào)錯(cuò)解決

引言

使用 pnpm install 安裝項(xiàng)目依賴時(shí)出現(xiàn):ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies,在 pnpm github issues 中找到相關(guān)解決方案。

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".
  • 問題原因:在 npm 3 中,不會(huì)再?gòu)?qiáng)制安裝 peerDependencies (對(duì)等依賴)中所指定的包,而是通過警告的方式來提示我們。pnpm 會(huì)在全局緩存已經(jīng)下載過的依賴包,如果全局緩存的依賴版本與項(xiàng)目 package.json 中指定的版本不一致,就會(huì)出現(xiàn)這種 hint 警告。
  • pnpm 團(tuán)隊(duì)成員給出的解答:

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.

二、處理方案

  • 在項(xiàng)目的 package.json 中配置 peerDependencyRules 忽略對(duì)應(yīng)的警告提示:
{
  "pnpm": {
    "peerDependencyRules": {
      "ignoreMissing": [
        "react"
      ]
    }
  }
}
  • .npmrc 配置文件中添加 strict-peer-dependencies=false ,這意味著將關(guān)閉嚴(yán)格的對(duì)等依賴模式。操作命令如下:
npm config set strict-peer-dependencies=false

參考鏈接:https://github.com/pnpm/pnpm/issues/4684

以上就是pnpm install:ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies的詳細(xì)內(nèi)容,更多關(guān)于pnpm install ERR的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

最新評(píng)論