前端报错:
[vite] Internal server error: Failed to load parser 'vue-eslint-parser' declared in '.eslintrc.js': Cannot find module 'vue-eslint-parser' 。
这个错误可能是因为ESLint没有找到vue-eslint-parser解析器,我的解决方法是:
-
安装解析器:
npm install vue-eslint-parser -save-dev
-
配置文件eslintrc.js 加上该解析器即可:
module.exports = defineConfig( parser: 'vue-eslint-parser', }