在VUE项目中遇到以下报错:Cannot read property ‘version’ of undefined TypeError: Cannot read property ‘version’ of undefined at module.exports (/redball_download/node_modules/@vue/cli-plugin-eslint/index.js:20:27) 如图: 这个错误是代码检测工具eslint的报错 上面错误大致原因为我删除了在package.json中eslint的配置,导致有一句eslint的依赖包 找不到对应的eslint相关配置代码如下: “@vue/cli-plugin-eslint”: “~4.5.0”, 从而导致了上述报错,经过我百度之后发现好几篇文章解决方案为删除当前项目的node_modules,然后重新npm install下载依赖包 经过我本人尝试之后发现并没有用 </