位置:- 正文

解决报错:Uncaught TypeError: Cannot read properties of undefined (reading ‘install‘)(unsupportedfirsthd解决办法)

编辑:rootadmin
解决报错:Uncaught TypeError: Cannot read properties of undefined (reading ‘install‘)

推荐整理分享解决报错:Uncaught TypeError: Cannot read properties of undefined (reading ‘install‘)(unsupportedfirsthd解决办法),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:uncaugth error,uncaugth error,unmatched报错,解决报错 kettle,unmatched报错,uncaugth error,unmatched报错,错误代码unb,内容如对您有帮助,希望把文章链接给更多的朋友!

在做vue2项目时出现如下错误,页面空白且控制台出现如下错误:

报错内容:

Uncaught TypeError: Cannot read properties of undefined (reading 'install')     at Vue.use (vue.runtime.esm.js?c320:5709:1)     at eval (index.js?5aa4:7:1)     at ./src/router/index.js (app.js:491:1)     at __webpack_require__ (app.js:584:33)     at fn (app.js:818:21)     at eval (main.js:4:65)     at ./src/main.js (app.js:480:1)     at __webpack_require__ (app.js:584:33)     at app.js:1706:109     at __webpack_require__.O (app.js:630:23)

报错图片:

解决报错:Uncaught TypeError: Cannot read properties of undefined (reading ‘install‘)(unsupportedfirsthd解决办法)

 

解决办法:

出现该情况的原因是vue-router安装的版本太高,一般vue2的项目对应的版本是vue-router@3版本

①在控制台输入: cnpm install --save vue-router@3.5.3 重新安装vue-router即可解决

如果没有安装cnpm命令的,可以先安装:cnpm install

②如果安装了cnpm 命令,则在控制台输入: cnpm install --save vue-router@3.5.3 重新安装vue-router即可解决

③没有cnpm命令 也可 则在控制台输入: npm install --save vue-router@3.5.3 重新安装vue-router即可解决

本文链接地址:https://www.jiuchutong.com/zhishi/269875.html 转载请保留说明!
下一篇链接:https://www.jiuchutong.com/zhishi/269876.html
免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络