Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

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

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

Error: [BABEL] C:devvuestudysrcmain.js: Cannot find module './src/data' (While processing: "C:\dev\vuestudy\node_modules\@vue\cli-plugin-babel\preset.js")

Any tips on this?

Thanks in advance.

UPDATE:

Kousha and Dave are right,after waiting for the core-js package update, I created a new project, and now it's working.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...