Module Error (from ./node_modules/eslint-loader/index.js):解决办法
2023-09-14 08:57:47 时间
vue启动项目报如下错误:
Failed to compile. ./src/components/Vcontent.vue Module Error (from ./node_modules/eslint-loader/index.js): E:\myvue\src\components\Vcontent.vue 4:15 error Parsing error: unexpected-character-in-attribute-name vue/no-parsing-error 4:37 error Parsing error: unexpected-character-in-attribute-name vue/no-parsing-error ? 2 problems (2 errors, 0 warnings)
当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
第四步:最重要的一步,将node_modules目录下的bin目录里面的.eslintrc.js文件拷贝到项目根目录下
第五步:启动服务,严重结果:
npm run serve
结束!
相关文章
- Node.js中的MongoDB
- js刷新当前页面的5种方式
- 使用 Node.js Stream API 减少服务器端内存消耗的一个具体例子
- JS如何替换元素内容
- JS_SDK实现网站应用QQ登录功能-QQ互联(源码版)
- 如何使用jscythe并通过Node.js的Inspector机制执行任意JS代码
- Node.js 相关资料网站汇总详解编程语言
- JS 中屏幕、浏览器和文档的高度、宽度和距离详解编程语言
- Node.js连接MySQL数据库实践(node连接mysql)
- Node.js和MSSQL数据库的完美结合:使用node mssql模块(node mssql模块)
- 使用Node.js链接/操作MS SQL数据库(node mssql使用)
- JS将文件传输至MySQL数据库(.js传文件至mysql)
- JS控制CSS样式的方法
- 浅析js文字滚动效果
- js代码优化点滴记录
- js每隔5分钟执行一次ajax请求的实现方法
- JS检测输入字符是否包含非法字符的示例代码
- JS控制一个DIV层在指定时间内消失的方法
- js确认删除对话框效果的示例代码
- node.js中使用node-schedule实现定时任务实例
- node.js中的path.delimiter方法使用说明
- node.js中的events.emitter.removeListener方法使用说明
- 我的Node.js学习之路(三)--node.js作用、回调、同步和异步代码以及事件循环
- 使用node.js半年来总结的10条经验