当前位置: 首页 > article >正文

【踩坑随笔】`npm list axios echarts`查看npm依赖包报错

npm list axios echarts查看npm依赖包出现以下报错,原因就是包的版本匹配问题,按照提示降axios版本或者自己升找合适的got版本,我这里是选择了降版本。本文记录仅做解决思路参考不一定适配大家的实际情况。

weed-detection-system@1.0.0 E:\Project\gitProject\weed_detection_project\frontend
├── axios@1.8.1 -> .\node_modules\.store\axios@1.8.1\node_modules\axios
├── echarts@5.6.0 -> .\node_modules\.store\echarts@5.6.0\node_modules\echarts
└─┬ electron@34.3.0 -> .\node_modules\.store\electron@34.3.0\node_modules\electron
  └─┬ @electron/get@2.0.3 -> .\node_modules\.store\@electron+get@2.0.3\node_modules\@electron\get
    └─┬ got@11.8.6 -> .\node_modules\.store\got@11.8.6\node_modules\got
      ├── axios@1.8.1 deduped invalid: "^0.20.0" from node_modules/.store/got@11.8.6/node_modules/got -> .\node_modules\.store\axios@1.8.1\node_modules\axios       
      └─┬ http2-wrapper@1.0.3 -> .\node_modules\.store\http2-wrapper@1.0.3\node_modules\http2-wrapper
        └─┬ got@11.8.6 -> .\node_modules\.store\got@11.8.6\node_modules\got
          └── axios@1.8.1 deduped invalid: "^0.20.0" from node_modules/.store/got@11.8.6/node_modules/got, "^0.20.0" from node_modules/.store/got@11.8.6/node_modules/got -> .\node_modules\.store\axios@1.8.1\node_modules\axios

npm error code ELSPROBLEMS
npm error invalid: axios@1.8.1 E:\Project\gitProject\weed_detection_project\frontend\node_modules\axios

安装过程一次性安装很容易出现包之间的依赖问题,最好按完后list检查一下,我这里选择自己去匹配对应的版本
,一个一个安装然后查看依赖
首先我安装我需要的第一个包cnpm install electron --legacy-peer-deps
然后用list查看它的依赖,然后发现有以下问题
在这里插入图片描述
包之间的版本不匹配,以防后续还有别的坑我直接删除node_modules文件夹重新安装包并指定版本

cnpm install electron@^34.3.0  http2-wrapper@^2.0.7

安装完后再查看依赖没有飘红了就可以接着安其他依赖项
在这里插入图片描述


http://www.kler.cn/a/573386.html

相关文章:

  • Redis maven项目 jedis 客户端操作(一)
  • 在https的网站里访问http的静态资源
  • AI数字人源码开发---SaaS化源码部署+PC+小程序一体化
  • 微信小程序投票系统的构建与实现
  • 200W数据去重入库的几种方法及优缺点
  • 云原生 DB 技术将取代K8S为基础云数据库服务-- 2025年云数据库专栏(一)
  • formdata 传list
  • c++ 接口/多态
  • 拉货搬家小程序开发中保障用户隐私和数据安全的方法
  • IntelliJ IDEA集成MarsCode AI
  • CentOS 8.2 更新源
  • 谷歌浏览器插件开发避免跨域以及流式数据输出
  • Oracle常用分析诊断工具(9)——AWR
  • OpenAI 最后一代非推理模型:OpenAI 发布 GPT-4.5预览版
  • 多线程的使用、同步和异步、synchronized、线程安全的单例模式、死锁、解决死锁
  • Windows系统编程(八)线程同步
  • 系统架构设计师—软件工程基础篇—系统分析与设计
  • FastGPT 源码:utils.ts 中的 RRF 实现
  • C++学习之路,从0到精通的征途:入门基础
  • yum修改阿里云