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

前端 未结 12 1511
孤城傲影
孤城傲影 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:16

    The situation where I encounter this problem is that I have moved the files from xxx to xxx/server. And then under xxx/server I will see the Error: Couldn't find preset "es2015" relative to directory "/Users/username/xxx" error. The real reason is that I have forgotten to move that .babelrc file under xxx. And after I move that .babelrc to xxx/server, the error goes away.

提交回复
热议问题