Issues with peer dependencies found

peer dependencies : 默认存在的依赖。 通常在开发组件和插件的时候用到。表示这些依赖不用下载,项目的仓库里有。

例子: 

package.json

peer dependencies : react 

问题背景: 

今天安装一些依赖,报了这个错误 Issues with peer dependencies found

那么这个错误是什么意思呢?

 WARN  Issues with peer dependencies found
.
└─┬ @typescript-eslint/eslint-plugin
  ├── ✕ missing peer typescript@"*"
  ├── ✕ missing peer eslint@"^6.0.0 || ^7.0.0 || ^8.0.0"
  ├── ✕ missing peer @typescript-eslint/parser@^5.0.0
  └─┬ @typescript-eslint/type-utils
    ├── ✕ missing peer typescript@"*"
    ├── ✕ missing peer eslint@"*"
    ├─┬ @typescript-eslint/typescript-estree
    │ ├── ✕ missing peer typescript@"*"
    │ └─┬ tsutils
    │   └── ✕ missing peer typescript@">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta"
    └─┬ @typescript-eslint/utils
      ├── ✕ missing peer eslint@"^6.0.0 || ^7.0.0 || ^8.0.0"
      └─┬ eslint-utils
        └── ✕ missing peer eslint@>=5
Peer dependencies that should be installed:
  @typescript-eslint/parser@^5.0.0                             typescript@>=2.8.0
  eslint@">=6.0.0 <7.0.0 || >=7.0.0 <8.0.0 || >=8.0.0 <9.0.0" 

表示这个依赖,在这个项目中缺少 peer dependencies 

为什么会缺少呢?

假如我们开发一个react的插件库, 那就要依赖react库。但通常我们创建一个react项目,就肯定有react库,那我们安装报错的这个库,因为不是在react项目中,缺少react库,所以报了 peer dependencies  错误。

解决办法: 根据提示,安装那些库。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值