【VUE】npm打包报错 Syntax Error: Error: Cannot find module ‘imagemin-gifsicle‘

一. Syntax Error: Error: Cannot find module 'imagemin-gifsicle'

  1. npm run build 报错,报错如下
  2. 原因
    这个错误消息显示缺少了 imagemin-gifsicle 模块,而它是 image-webpack-loader 的依赖项,导致构建失败。
  3. 解决
    (1)方法一

    (2)方法二
    卸载已有的image-webpack-loader,用 cnpm 重新安装
bash 复制代码
// 卸载
 npm uninstall image-webpack-loader
// cnpm 安装
cnpm install --save-dev image-webpack-loader

二. Vue packages version mismatch:vue-template-compiler

  1. 报错信息如下
bash 复制代码
Error: 

Vue packages version mismatch:

- vue@2.6.14 (D:\workDir\xxx\xxx\web\node_modules\vue\dist\vue.runtime.common.js)
- vue-template-compiler@2.7.14 (D:\workDir\xxx\xxx\web\node_modules\vue-template-compiler\package.json)

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.
  1. 原因
    这个错误信息显示您当前安装的 Vue.js 版本与 vue-template-compiler 版本不匹配,可能会导致一些问题。为了确保正常工作,应该确保这两者使用相同的版本。
  2. 解决
    更新 vue-template-compiler 版本
    npm install vue-template-compiler@2.6.14

三. This dependency was not found:composition-api

  1. 报错信息如下
bash 复制代码
This dependency was not found:

* @vue/composition-api/dist/vue-composition-api.mjs in ./node_modules/vue-demi/lib/index.mjs

To install it, you can run: npm install --save @vue/composition-api/dist/vue-composition-api.mjs
Error from chokidar (D:\): Error: EBUSY: resource busy or locked, lstat 'D:\DumpStack.log.tmp'
  1. 原因
    `这个错误提示表明项目中的某个模块依赖了 @vue/composition-api 的特定文件 vue-composition-api.mjs,但是该文件未被找到,导致构建失败。
  2. 解决
    安装 @vue/composition-api
bash 复制代码
npm install --save @vue/composition-api

四. These dependencies were not found:vab-icons vab-icons/lib/vab-icons.css

  1. 报错如下
相关推荐
踩着两条虫3 小时前
AI驱动的Vue3应用开发平台深入探究(十):物料系统之内置组件库
android·前端·vue.js·人工智能·低代码·系统架构·rxjava
swipe3 小时前
AI 应用里的 Memory,不是“保存聊天记录”,而是管理上下文预算
前端·llm·agent
慧一居士3 小时前
nuxt3 项目和nuxt4 项目区别和对比
前端·vue.js
威联通安全存储4 小时前
破除“重前端、轻底层”的数字幻象:如何夯实工业数据的物理底座
前端·python
inksci4 小时前
Js生成安全随机数
前端·微信小程序
吴声子夜歌4 小时前
TypeScript——泛型
前端·git·typescript
猩猩程序员5 小时前
Pretext:一个绕过 DOM 的纯 JavaScript 排版引擎
前端
竹林8185 小时前
从“连接失败”到丝滑登录:我用 ethers.js 连接 MetaMask 的完整踩坑实录
前端·javascript
神舟之光5 小时前
jwt权限控制简单总结(乡村意见簿-vue-express-mongdb)
前端·vue.js·express
铭毅天下5 小时前
EasySearch Rules 规则语法速查手册
开发语言·前端·javascript·ecmascript