小么小二郎~
2021-09-06 15:16
采纳率: 25%
浏览 27

1.vue 引入 echarts 的时候,报错,2.npm下载依赖的时候不成功,cnpm 就行

引入:

img

报错如图:

img

Error in mounted hook: "TypeError: Cannot read property 'init' of undefined"

于是搜索问题,说是echarts的版本太高,新版本不稳定。于是卸载 echarts, 结果报错

img

npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! While resolving: cp@1.0.0
npm ERR! Found: webpack@3.12.0
npm ERR! node_modules/webpack
npm ERR!   dev webpack@"^3.6.0" from the root project
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^5.0.0" from less-loader@9.1.0
npm ERR! node_modules/less-loader
npm ERR!   dev less-loader@"^9.0.0" from the root project
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! See D:\NDjs\node_cache\eresolve-report.txt for a full report.

好像是 npm版本(6.14.14)太低,于是升级npm(7.0.0)后,再次卸载,依然报错!

img

npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! While resolving: cp@1.0.0
npm ERR! Found: webpack@3.12.0
npm ERR! node_modules/webpack
npm ERR!   dev webpack@"^3.6.0" from the root project
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^5.0.0" from less-loader@9.1.0
npm ERR! node_modules/less-loader
npm ERR!   less-loader@"^9.0.0" from the root project

现在又蒙了,不知道咋弄。我该咋办,求解

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • 真我x 2021-09-06 15:55

    命明后面加 --force试试

    打赏 评论

相关推荐 更多相似问题