Failed to compile../src/App.vue Module Error (from ./node_modules/eslint-loader/index.js): 解决方法

 Failed to compile../src/App.vue Module Error (from ./node_modules/eslint-loader/index.js): 解决方法_第1张图片

当vue渲染html为原生标签时出这个错误,需要修改配置项。

优化如下:

第一步:初始化并重新安装eslint

npm init -y
npm install eslint --save-dev

第二步:进入node_modules下的bin目录,并初始化eslint

cd ./node_modules/.bin/   //找到文件目录
eslint --init

第三步:设置配置选项,除选择vue.js外,其他都选择默认项或者y或者Y,如下仅仅到选择vue.js步骤

? How would you like to use ESLint? To check syntax and find problems
? What type of modules does your project use? JavaScript modules (import/export)
? Which framework does your project use? Vue.js
? Does your project use TypeScript? Yes
? Where does your code run? Browser
? What format do you want your config file to be in? JavaScript
The config that you've selected requires the following dependencies:

eslint-plugin-vue@latest @t

你可能感兴趣的:(vue渲染错误,npm,javascript,vue.js,前端,npm)