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

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

相关推荐
军军君0120 小时前
数字孪生监控大屏实战模板:交通云实时数据监控平台
前端·javascript·css·vue.js·typescript·前端框架·echarts
知识分享小能手1 天前
ECharts入门学习教程,从入门到精通,综合实战——ECharts电商数据可视化完整知识点+案例代码(8)
学习·信息可视化·echarts
知识分享小能手3 天前
ECharts入门学习教程,从入门到精通,ECharts高级功能(6)
前端·学习·echarts
qq_283720053 天前
Python3 模块精讲:pyecharts —— 交互式数据可视化全解与实战
python·信息可视化·数据分析·echarts·数据可视化·pyecharts
军军君014 天前
数字孪生监控大屏实战模板:云数据中心展示平台
前端·javascript·vue.js·typescript·前端框架·es6·echarts
军军君015 天前
数字孪生监控大屏实战模板:政务服务大数据
前端·javascript·vue.js·typescript·前端框架·echarts·less
知识分享小能手7 天前
ECharts入门学习教程,从入门到精通,ECharts 数据可视化入门介绍(1)
学习·信息可视化·echarts
军军君017 天前
数字孪生监控大屏实战模板:商圈大数据监控
前端·javascript·vue.js·typescript·前端框架·echarts·three
smilejingwei8 天前
用 AI 编程生成 ECharts 图表并嵌入报表的实践
前端·人工智能·echarts·bi·报表工具·商业智能
Highcharts.js8 天前
React 应用中的图表选择:Highcharts vs Apache ECharts 深度对比
前端·javascript·react.js·echarts·highcharts·可视化图表·企业级图表