【踩坑随笔】`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

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

相关推荐
java水泥工4 小时前
基于Echarts+HTML5可视化数据大屏展示-白茶大数据溯源平台V2
大数据·echarts·html5
码上暴富2 天前
Echarts雷达图根据数值确定颜色
前端·javascript·echarts
懒大王95272 天前
uni-app + Vue3 开发展示 echarts 图表
前端·uni-app·echarts
小谭鸡米花3 天前
uni小程序中使用Echarts图表
前端·小程序·echarts
@AfeiyuO4 天前
分类别柱状图(Vue3)
typescript·vue·echarts
Pu_Nine_95 天前
10 分钟上手 ECharts:从“能跑”到“生产级”的完整踩坑之旅
前端·javascript·echarts·css3·html5
小白_ysf5 天前
uniapp和vue3项目中引入echarts 、lime-echart(微信小程序、H5等)
微信小程序·uni-app·echarts·h5·lime-echart
Chan166 天前
【智能协同云图库】基于统一接口架构构建多维度分析功能、结合 ECharts 可视化与权限校验实现用户 / 管理员图库统计、通过 SQL 优化与流式处理提升数据
java·spring boot·后端·sql·spring·intellij-idea·echarts
zhangzuying10266 天前
基于Vue3 +ElementuiPlus + Dexie.js自研的浏览器插件新建标签页tab
vue.js·typescript·echarts
java水泥工8 天前
基于Echarts+HTML5可视化数据大屏展示-学生综合成绩评价系统大屏
spring boot·echarts·html5