Requires Babel “7.0.0-0” but was loaded with “6.26.3”

前端 未结 10 888
深忆病人
深忆病人 2020-12-08 06:16

Keep getting this error no matter what I tried installing (babel wise) as I follow other similar reports. this is the stack trace:

error: bundli         


        
10条回答
  •  星月不相逢
    2020-12-08 07:07

    It is NOT recommended to install babel globally. It might be that your IDE has recognized your globally installed package and is going based off of that one. Or what is more likely is that you have have packages that conflict with each other. e.g babel-cli conflicts with @babel/cli

    While you can install Babel CLI globally on your machine, it's much better to install it locally project by project.

    yarn remove global @babel/cli @babel/core
    

    In project directory...

    yarn remove babel-cli 
    yarn add @babel/cli @babel/core @babel/node --dev
    

提交回复
热议问题