在vue项目中,执行 npm run dev 时提示 { parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }


npm run dev 错误提示:

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

 

解决方法:

找到你的工程文件夹里的 YourProName\node_modules\vue-loader\lib\template-compiler\index.js

//将以下代码
if (!isProduction) {
  code = prettier.format(code, { semi: false, parser: 'babylon' })
}
 
//修改为:
 
if (!isProduction) {
  code = prettier.format(code, { semi: false, parser: 'babel' })
-----------------------------------
{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }.
https://blog.51cto.com/u_15127595/4117834


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM