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

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

powershell 复制代码
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文件夹重新安装包并指定版本

clike 复制代码
cnpm install electron@^34.3.0  http2-wrapper@^2.0.7

安装完后再查看依赖没有飘红了就可以接着安其他依赖项

相关推荐
小小愿望2 天前
ECharts 实战技巧:揭秘 X 轴末项标签 “莫名加粗” 之谜及破解之道
前端·echarts
じòぴé南冸じょうげん2 天前
解决ECharts图表上显示的最小刻度不是设置的min值的问题
前端·javascript·echarts
我在北国不背锅3 天前
基于Java的Markdown转Word工具(标题、段落、表格、Echarts图等)
java·word·echarts·markdown
码界筑梦坊3 天前
135-基于Spark的抖音数据分析热度预测系统
大数据·python·数据分析·spark·毕业设计·echarts
安卓开发者3 天前
RxJava 核心概念解析:构建响应式Android应用的基石
android·echarts·rxjava
码界筑梦坊6 天前
105-基于Flask的珍爱网相亲数据可视化分析系统
python·ai·信息可视化·flask·毕业设计·echarts
安卓开发者6 天前
深入理解Android Kotlin Flow:响应式编程的现代实践
android·kotlin·echarts
别来无恙1499 天前
Spring Boot + ECharts 极简整合指南:从零实现动态数据可视化大屏
spring boot·信息可视化·echarts
莲青见卿9 天前
react+echarts实现变化趋势缩略图
javascript·react.js·echarts
爱吃香菇的小白菜10 天前
echarts、antv图表类 y轴范围 计算方法
前端·echarts