[已解决]Cannot read properties of undefined (reading ‘install‘)
解决了使用vue-router时的报错。
·
唉,对于计算机的bug是真的很害怕。但是这个错误,我发现解决起来还是蛮简单的。
参考这篇博客:
原因分析
原因主要就是我们在下载vue-router的时候下载的是最新版的(以4开头),但是这个版本它是给vue3准备的,所以我们要卸载router,然后限制他的版本。
解决方法:
在终端运行:
npm uninstall vue-router
npm install --save vue-router@3
成功解决!!!
更多推荐
已为社区贡献2条内容
所有评论(0)