TypeError: token.type.endsWith is not a function

发布时间 2023-06-27 14:04:32作者: 女神怪阿姨

起因

公司产品项目拉下来,安装完依赖就报这个错误

token.type.endsWith is not a function 

解决方案

发现是eslint的版本

将 babel-eslint 版本为10.1.0,把版本降为8.2.2,即重新安装指定版本的依赖。

重新安装,并重启后,解决问题

 

npm install babel-eslint@8.2.2 --save