Error: Couldn't find preset “es2015” relative to directory “/Users/username”

前端 未结 12 1494
孤城傲影
孤城傲影 2020-12-13 16:59

I get the following error when trying to use gulp-babel:

Error: Couldn\'t find preset \"es2015\" relative to directory \"/Users/username\"

12条回答
  •  悲哀的现实
    2020-12-13 17:21

    Check if you have .babelrc file in the root folder of your Project. If not create .babelrc file and add the following:

    {
      "presets": ["es2015"]
    }
    

    It fixed the issue.

提交回复
热议问题