在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