解析错误:未检测到 Babel 配置文件

分享于2022年07月17日 node.js vue.js vuejs2 问答
【问题标题】:解析错误:未检测到 Babel 配置文件(Parsing error: No Babel config file detected)
【发布时间】:2022-06-15 09:57:30
【问题描述】:

我正在尝试在 vue.js 中创建一个项目。但是我在创建项目后遇到了这个问题。

Parsing error: No Babel config file detected for C:\\HotelManagmet\clienthotel\babel.config.js. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files. 我无法解决它,我尝试重新安装 node.js 和 Visual Studio 代码,但问题仍然存在。尝试运行 npm audit fix --force 但不幸的是结果是一样的。有人知道它可能是什么吗?


【解决方案1】:

在您的终端中,运行 npm install 。然后,将您的 babel.config.js 内容替换为以下内容:

  "presets": [
    "@vue/cli-plugin-babel/preset"
  ]
}

  • 这条命令真的完整吗?我想念左括号 {