Module not found: Error: Can't resolve 'core-js/es6'

后端 未结 9 1389
轻奢々
轻奢々 2020-12-12 14:49

I\'ve got a problem with my build process in relation to my React app.

I always get the following error:

Module not found: Error: Can\'t resolve \'co

9条回答
  •  醉酒成梦
    2020-12-12 15:20

    I found possible answer. You have core-js version 3.0, and this version doesn't have separate folders for ES6 and ES7; that's why the application cannot find correct paths.

    To resolve this error, you can downgrade the core-js version to 2.5.7. This version produces correct catalogs structure, with separate ES6 and ES7 folders.

    To downgrade the version, simply run:

    npm i -S core-js@2.5.7
    

    In my case, with Angular, this works ok.

提交回复
热议问题