npm run dev 时报错in ./node_modules/@videojs-player/vue/dist/videojs-player.esm.js "export 'defineComponent' (imported as 'e') was not found in 'vue'
时间: 2024-03-28 21:42:34 浏览: 172
这个错误可能是由于你使用的 vue 版本与 @videojs-player/vue 版本不兼容导致的。你可以尝试以下几种方法解决这个问题:
1. 升级或降级 @videojs-player/vue 和 vue 的版本,使它们兼容。
2. 在你的项目中安装 vue 的 defineComponent 模块,可以使用以下命令安装:
```
npm install @vue/runtime-core
```
然后在你的项目中添加以下代码:
```
import { defineComponent } from 'vue'
```
然后将 @videojs-player/vue 中的 defineComponent 替换为 vue 中的 defineComponent。
3. 在你的项目中使用 @videojs/player 来代替 @videojs-player/vue。这个包不依赖于 vue,所以不会出现这个错误。
相关问题
This dependency was not found: * @/api/wms/category in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/system/category/index.vue?vue&type=script&lang=js& To install it, you can run: npm install --save @/api/wms/category This dependency was not found: * @/api/wms/category in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/system/category/index.vue?vue&type=script&lang=js& To install it, you can run: npm install --save @/api/wms/category
This error message indicates that the dependency "@/api/wms/category" could not be found. It seems that you need to install this dependency in order to resolve the issue.
To install the missing dependency, you can run the following command in your terminal:
```
npm install --save @/api/wms/category
```
This command will install the "@/api/wms/category" package and save it as a dependency in your project's package.json file. Once the installation is complete, you should be able to resolve the dependency and resolve the error.
his dependency was not found: * three/addons/controls/OrbitControls.js in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/three/three.vue?vue&type=script&lang=js& To install it, you can run: npm install --save three/addons/controls/OrbitControls.js
这个错误提示说缺少 OrbitControls.js 这个文件,你可以运行以下命令安装它:
```
npm install --save three
```
如果已经安装了 three,则可以尝试重新安装:
```
npm uninstall three
npm install three
```
如果还是不行,可能是版本问题,你可以尝试安装指定版本的 three:
```
npm install --save three@0.100.0
```
具体版本号可以根据你的项目需要进行调整。
阅读全文