Parsing error: No Babel config file detected for XXXXX

简介: Parsing error: No Babel config file detected for XXXXX

一、报错如下:

二、报错原因

eslint根据eslint配置文件的parserOption,知道了要使用babel对代码进行解析,但是解析babel需要使用babel配置文件,由于找不到配置文件(babel配置文件默认需要放在根目录下),所以会报错。因此,添加requireConfigFile:

false,本质上是告诉eslint,不用查找这个配置文件了,虽然表面上可以解决这个报错,但是在babel配置文件里写的东西也就失效了。

二、解决办法

方法一:自己找到的第一种解决方法: 只用VScode打开项目文件就可以解决,找到你的项目文件,拖拽到VScode上打开就行了(把项目文件作为根目录)

方法二:有人说的解决方法就是配置requireConfigFile:false,本质上就是告诉eslint,不用给我查找这个配置文件了,但是我又继续查了资料,看到有博主说,这样只是从表面上的确可以解决这个报错,但是你在babel配置文件里写的东西也就失效了。后面我又查了其他资料解决了这个报错。

在VSCode中 把它作为根目录打开,我已成功解决


相关文章
|
缓存 关系型数据库 MySQL
error: Failed dependencies: mariadb-connector-c-config is obsoleted by mysql-community-server-8.0.36-1.el7.x86_64 问题解决
error: Failed dependencies: mariadb-connector-c-config is obsoleted by mysql-community-server-8.0.36-1.el7.x86_64 问题解决
933 19
|
JavaScript
Parsing error: No Babel config file detected for 。。
Parsing error: No Babel config file detected for 。。
388 3
|
前端开发
命令行创建React项目
命令行创建React项目
命令行创建React项目
|
NoSQL Redis
进行主从复制时出现的异常FATAL CONFIG FILE ERROR (Redis 6.2.6)Reading the configuration file
进行主从复制时出现的异常FATAL CONFIG FILE ERROR (Redis 6.2.6)Reading the configuration file
718 0
|
关系型数据库 MySQL 数据库
Mysql-错误处理: Found option without preceding group in config file
Mysql-错误处理: Found option without preceding group in config file
1482 0
|
Kubernetes 容器
k8s-error execution phase upload-config/kubelet: Error writing Crisocket...
k8s-error execution phase upload-config/kubelet: Error writing Crisocket...
389 0
|
关系型数据库 MySQL Linux
DVWA CentOS Could not connect to the MySQL service. Please check the config file.
DVWA CentOS Could not connect to the MySQL service. Please check the config file.
174 0
|
JavaScript Cloud Native Go
Error: Cannot find module ‘webpack/bin/config-yargs‘ at Function.Module._resolveFilename (intern
Error: Cannot find module ‘webpack/bin/config-yargs‘ at Function.Module._resolveFilename (intern
169 0
|
关系型数据库 MySQL 数据库
【报错】DVWA遇到Could not connect to the database service. Please check the config file. Database Error
【报错】DVWA遇到Could not connect to the database service. Please check the config file. Database Error
2312 0
|
算法 安全 Java
微服务(四)-config配置中心的配置加解密
微服务(四)-config配置中心的配置加解密