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

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

powershell 复制代码
[email protected] E:\Project\gitProject\weed_detection_project\frontend
├── [email protected] -> .\node_modules\.store\[email protected]\node_modules\axios
├── [email protected] -> .\node_modules\.store\[email protected]\node_modules\echarts
└─┬ [email protected] -> .\node_modules\.store\[email protected]\node_modules\electron
  └─┬ @electron/[email protected] -> .\node_modules\.store\@[email protected]\node_modules\@electron\get
    └─┬ [email protected] -> .\node_modules\.store\[email protected]\node_modules\got
      ├── [email protected] deduped invalid: "^0.20.0" from node_modules/.store/[email protected]/node_modules/got -> .\node_modules\.store\[email protected]\node_modules\axios       
      └─┬ [email protected] -> .\node_modules\.store\[email protected]\node_modules\http2-wrapper
        └─┬ [email protected] -> .\node_modules\.store\[email protected]\node_modules\got
          └── [email protected] deduped invalid: "^0.20.0" from node_modules/.store/[email protected]/node_modules/got, "^0.20.0" from node_modules/.store/[email protected]/node_modules/got -> .\node_modules\.store\[email protected]\node_modules\axios

npm error code ELSPROBLEMS
npm error invalid: [email protected] 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

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

相关推荐
这可不简单5 小时前
方便易懂的自适应方案---echarts和dom样式大小自适应
前端·vue.js·echarts
八月林城1 天前
echarts在uniapp中使用安卓真机运行时无法显示的问题
android·uni-app·echarts
路很长OoO3 天前
鸿蒙手写ECharts_手势惯性(条形统计图)
echarts·harmonyos·canvas
Alice_hhu4 天前
ResizeObserver 解决 echarts渲染不出来,内容宽度为 0的问题
前端·javascript·echarts
纯阳阳4 天前
如何用echart绘制圆柱
前端·echarts
qq_10613834578 天前
SpringBoot+Vue+Echarts实现可视化图表的渲染
vue.js·spring boot·echarts
Shi_haoliu10 天前
前端vue2-完全前端生成pdf->pdf-lib,html2canvas+jspdf,原生打印,三种方式(打印带有echarts图的pdf)
前端·javascript·vue.js·git·pdf·echarts·html5
全宇宙最最帅气的哆啦A梦小怪兽10 天前
【Axure结合Echarts绘制图表】
前端·javascript·echarts·产品经理·原型
阿乐今天敲代码没11 天前
echarts实现项目进度甘特图
前端·echarts·甘特图
阿乐今天敲代码没14 天前
echarts定制化柱状图——条纹柱状图
前端·echarts