我正在将Homestead环境与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,但无法解决问题。