Cannot find module './src/data' with vue-cli

后端 未结 4 538
花落未央
花落未央 2020-12-16 12:24

I created a project with vue-cli 4.1.1, and after running yarn serve, i got the following error

Error: [BABEL] C:\\dev\\vuestudy\\src\\main.js: Cannot find m         


        
相关标签:
4条回答
  • 2020-12-16 12:55

    It looks like there's been a bad build of npm package core-js-compat. This is a deep-down dependency of Babel. Lots of things will be affected, things that use Babel.

    You will experience this problem if you have core-js-compat v.3.4.6. You can check this by doing npm list core-js-compat. The problem is apparently fixed by v.3.4.7, which was pushed out pretty quickly, about half-an-hour later, but unfortunately it takes a while to spread out through the repositories. You can either wait until an npm update gets you v.3.4.7 or you can go manually download v.3.4.7 if you want to get going right away.

    0 讨论(0)
  • 2020-12-16 13:11

    You may be able to force install the not-broken version with

    npm i core-js-compat@3.4.7 --save

    It worked on my machine™

    0 讨论(0)
  • 2020-12-16 13:16

    This is a bug with core-js-compat v3.4.6, but already the fix has gone with v3.4.7. See https://github.com/zloirock/core-js/issues/712 for more detail.

    0 讨论(0)
  • 2020-12-16 13:16

    With Vue / Nuxt, you can delete package-lock.json and node_modules and do an npm install to fix this issue.

    0 讨论(0)
提交回复
热议问题