{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }.

2021-07-08 10:13:45 浏览数 (2)

npm run dev 错误提示:

代码语言:javascript复制
{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }.

解决方法:

找到你的工程文件夹里的 YourProNamenode_modulesvue-loaderlibtemplate-compilerindex.js

代码语言:javascript复制
//将以下代码
if (!isProduction) {
  code = prettier.format(code, { semi: false, parser: 'babylon' })
}
 
//修改为:
 
if (!isProduction) {
  code = prettier.format(code, { semi: false, parser: 'babel' })
}

0 人点赞