npm - 找不到已安装的包
问题描述
我正在使用带有 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,但它并没有解决问题。
解决方案
推荐阅读
- asp.net-core - 如何覆盖 ASP.NET Core 中的 tilda (~) 分辨率?
- java - 解析 JSON 时出错 (MismatchedInputException)
- android - Zxing 条码库 Android Studio
- javascript - 在我检查元素到该特定标签之前,不会在 iframe 中获取 DOM 元素
- r - PowerBI R 脚本运行时错误,从 rlang 0.3.0 开始,不推荐使用 rlang 命名空间为 UQ() 加前缀
- java - 在关闭期间,骆驼报告没有可用的消费者,但后来它关闭了同一个消费者,
- javascript - 除带有 Javascript/jQuery 的按钮外,整个表格行均可点击
- asp.net-mvc - 带有 Asp.Net MVC 的自动版本
- arrays - 如何检查数组中的所有值是否相同?
- go - 关闭和测距 go 通道