首页 > 解决方案 > 找不到已安装的包

问题描述

我正在使用带有 Vagrant 版本 2.2.4、homestead 7.2.1 和 npm 6.7.0 的宅基地环境。

我正在尝试安装和使用一个名为“vuetify-material-dashboard”的模块。

我已经用 npm 安装了模块

npm install --save vuetify-material-dashboard

我已经在我的 app.js 中加载了模块

import Vue from 'vue';
import VueRouter from 'vue-router';
import routes from './routes';
import VueResource from 'vue-resource';
import { TableComponent, TableColumn } from 'vue-table-component';
import Vuetify from 'vuetify';
import Card from 'vuetify-material-dashboard';

Vue.component('table-component', TableComponent);
Vue.component('table-column', TableColumn);

Vue.use(VueResource);
Vue.use(VueRouter);
Vue.use(Vuetify);
Vue.use(Card);


const app = new Vue({
    el: '#app',
    router: new VueRouter(routes),


});

但是,在运行 npm run dev / npm run watch-poll 我得到错误

ERROR in ./resources/js/app.js
Module not found: Error: Can't resolve 'vuetify-material-dashboard' in 'D:\Homestead_Projects\project\resources\js'
 @ ./resources/js/app.js 23:0-46 29:8-12
 @ multi ./resources/js/app.js ./resources/sass/index.sass
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ dev: `cross-env node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

有趣的是,安装的其他模块在编译时不会抛出错误。

我已经从宅基地/本地删除、重建了 node_modules,但它并没有解决问题。

标签: npmhomestead

解决方案


推荐阅读