无法在 vue 项目中导入 popper - 找不到模块:错误:无法解析 @popperjs/core
我正在尝试在我的 vue 3 项目中导入 bootstrap js 文件和 popper。我收到此错误,也许我导入文件时做错了什么?
./node_modules/bootstrap/dist/js/bootstrap.min.js
Module not found: Error: Can't resolve '@popperjs/core' in '/Users/admin/Sites/host/node_modules/bootstrap/dist/js'
这是我的 main.js
文件中的代码
import { createApp } from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
import 'bootstrap/dist/css/bootstrap.min.css'
import 'popper.js/dist/popper.min.js'
import 'bootstrap/dist/js/bootstrap.min.js'
import '@fortawesome/fontawesome-free/css/all.min.css'
createApp(App).use(store).use(router).mount('#app')
I'm trying to import bootstrap js files and popper in my vue 3 project. I'm getting this error, maybe I'm doing something wrong when I import the files?
./node_modules/bootstrap/dist/js/bootstrap.min.js
Module not found: Error: Can't resolve '@popperjs/core' in '/Users/admin/Sites/host/node_modules/bootstrap/dist/js'
this is the code in my main.js
file
import { createApp } from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
import 'bootstrap/dist/css/bootstrap.min.css'
import 'popper.js/dist/popper.min.js'
import 'bootstrap/dist/js/bootstrap.min.js'
import '@fortawesome/fontawesome-free/css/all.min.css'
createApp(App).use(store).use(router).mount('#app')
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论