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

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

相关推荐
weixin_459548901 天前
QT+Echarts初始示例
qt·echarts
毕设源码-钟学长2 天前
【开题答辩全过程】以 公寓出租系统为例,包含答辩的问题和答案
java·eclipse·echarts
凯小默2 天前
37-实现地图配置项(完结)
echarts·vue3
疯笔码良2 天前
Vue + Echarts 实现科技感数据大屏
vue.js·echarts
凯小默3 天前
36-引入地图
echarts·vue3
@AfeiyuO3 天前
Vue3 旭日图
vue·echarts
毕设源码-钟学长3 天前
【开题答辩全过程】以 高校健康申报系统为例,包含答辩的问题和答案
java·tomcat·echarts
凯小默3 天前
【TypeScript+Vue3+Vite+Vue-router+Vuex+Mock 进行 WEB 前端项目实战】学习笔记共 89 篇(完结)
typescript·echarts·mock·vue3·vite·vuex·vue-router
毕设源码-钟学长4 天前
【开题答辩全过程】以 基于Echarts的电商用户数据可视化平台设计与实现- -为例,包含答辩的问题和答案
前端·信息可视化·echarts
paopaokaka_luck5 天前
基于SpringBoot+Vue的高校心理健康服务平台(websocket实时聊天、AI分析、Echarts图形化分析)
vue.js·spring boot·websocket·mysql·echarts