使用 vue-cli 找不到模块“./src/data" [英] Cannot find module './src/data' with vue-cli
问题描述
我用vue-cli 4.1.1创建了一个项目,运行yarn serve后出现如下错误
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")
对此有什么建议吗?
提前致谢.
更新:
Kousha 和 Dave 是对的,在等待 core-js 包更新后,我创建了一个新项目,现在可以运行了.
Kousha and Dave are right,after waiting for the core-js package update, I created a new project, and now it's working.
推荐答案
看起来 npm 包 core-js-compat
的构建有问题.这是 Babel 的深层依赖.很多东西都会受到影响,使用 Babel 的东西.
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.
如果你有 core-js-compat v.3.4.6,你会遇到这个问题.您可以通过执行 npm list core-js-compat
来检查这一点.这个问题显然是由 v.3.4.7 解决的,它很快被推出,大约半小时后,但不幸的是它需要一段时间才能在存储库中传播.您可以等到 npm update
获得 v.3.4.7,或者如果您想立即开始,可以手动下载 v.3.4.7.
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.
这篇关于使用 vue-cli 找不到模块“./src/data"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!