VueJS-找不到模块:错误:无法解析"@ babel/runtime/regenerator" [英] VueJS - Module not found: Error: Can't resolve '@babel/runtime/regenerator'
问题描述
我遇到此错误
Module not found: Error: Can't resolve '@babel/runtime/regenerator' in 'C:\wamp64\www\project-dev\modules\Gallery\Resources\Assets\Backend\Views\Album'
当我执行此命令npm run dev
.
Module not found: Error: Can't resolve '@babel/runtime/regenerator' in 'C:\wamp64\www\project-dev\modules\Gallery\Resources\Assets\Backend\Views\Album'
when I execute this commandnpm run dev
.
因此,请解释我的laravel项目目录:
So to explain my laravel project directory:
app
modules
auth
backend
gallery
themes
admin
node_modules
resources
js
components
router
index.js
store
app.js
sass
views
package.json
webpack.mix.js
因此在我的vuejs应用程序的router/index.js
中,我将包括来自模块的路由.
So in my router/index.js
of vuejs app, I will includes routes from a module.
我做这个:
import GalleryRoutes from "../../../../../modules/Gallery/Resources/Assets/Backend/routes";
// Vue Router
const router = new VueRouter({
base: '/admin',
mode: 'history',
routes: [
...constantRoutes,
...GalleryRoutes,
],
linkActiveClass: "active",
linkExactActiveClass: "active",
});
Gallery模块中的
routes.js
文件:
routes.js
file from Gallery module:
// Views
import AlbumIndex from './Views/Album/Index.vue'
// Routes
export default [
// AlbumIndex
{
path: 'gallery/albums',
component: AlbumIndex,
name: 'backend.gallery.album.index',
meta: {
heading: 'Gallery',
title: 'Albums',
icon: 'fas fa-images',
showed: true
}
}
];
但是我得到上面的错误.
But I get the error above.
我不确定这是与node_modules
文件夹有关的错误.
有可能实现我想做的事情? (包括我的根应用目录之外的.Vue或.js文件.)
I think this is a bug related to the node_modules
folder, I'm not sure.
It's possible to achieve what I want to do? (include .Vue or .js files from outside my root app directory).
PS:我尝试使之回答以下问题:使用模块方法的laravel应用程序的后端(VueJS)
PS: I try to make this to try to answer this question: Backend (VueJS) of laravel application with modules approach
感谢您的帮助:)
推荐答案
它正在寻找未安装的依赖项.在您的情况下,您可以执行npm i babel-runtime --save
来安装丢失的依赖项.
It's looking for a dependency that is not installed. In your case you can do npm i babel-runtime --save
to install that dependency you're missing.
这篇关于VueJS-找不到模块:错误:无法解析"@ babel/runtime/regenerator"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!