vue eslint报错:TypeError: token.type.endsWith is not a function
Vue 报错 not is type Function Token TypeError
2023-09-27 14:24:12 时间
原文地址:https://jue.leheavengame.com/article/61b4946d3a91de0b5dc12930
问题发现
维护了很久的vue项目,发现eslint
会报错:TypeError: token.type.endsWith is not a function
问题原因
babel-eslint
npm包已被弃用,我们无法再下载到这个包,导致项目缺少依赖报错。
问题解决
将弃用的babel-eslint
换成@babel/eslint-parser
即可。
- 先移除依赖:
yarn remove babel-eslint
或者npm uninstall --save-dev babel-eslint
- 然后添加依赖:
yarn add --dev @babel/eslint-parser
或者npm install --save-dev @babel/eslint-parser
注意:eslint
和eslint-plugin-vue
依赖也是必须的,项目若没有也需要添加。 - 最后修改.eslintrc.js文件配置:
parserOptions: {
parser: '@babel/eslint-parser'
}
相关文章
- (尚036) vue_demo_users_todo 初始化显示+(尚037)+搜索
- vue - helloWorld
- Vue.js 使用cordova camera插件调取相机
- 使用Vant 报错(0 , vue__WEBPACK_IMPORTED_MODULE_10__.ref) is not a function)
- 来吧!一文彻底搞定Vue组件!
- 使用Docker部署Spring-Boot+Vue博客系统
- vue-cli运行报错
- vue报错 :NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated"}
- 关于vue的语法规则检测报错问题
- Vue---定义全局过滤器---时间格式化
- Vue移动端报错[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive.
- vue中的main.js打开直接报错问题解决
- 【报错系列】安装vue-cli报错 code EEXIST path C:UsersAdministratorAppDataRoamingnpmvue
- Vue报错笔记(1)vue.esm.js?efeb:628 [Vue warn]: Property or method “handleClick“ is not defined on the...
- vue stylus的安装及使用方法(报错问题处理)
- vue学习笔记七:Jquery VS Vue之杂项方法明细对照
- vue实现悬浮球组件
- nuxtjs在vue组件中使用window对象编译报错的解决方法
- 解决IE报错[vue router]Failed to resolve async component default:strict 模式下不允许分配到只读属性
- 解决Vue用Nginx做web服务器报错favicon.ico 404 (Not Found)的问题
- 5种处理Vue异常的方法
- Vue 报错 之 Syntax Error: TypeError: this.getOptions is not a function
- 07-vue-cli-export 的使用
- Vue开发实例(06)之Vue3注册Element-ui报错解决
- Vue项目安装core-js报错解决方案
- vue 外卖app(3) 利用slot分发内容
- vue组件终端报错: error Component name “xxx“ should always be multi-word vue/multi-word-component-names
- 解决使用VueCli创建Vue项目报错:Warning: name can no longer contain capital letters
- vue数据代理