【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. 报错如下
相关推荐
其实防守也摸鱼4 分钟前
内网安全防护实践:从攻击视角理解防御要点
java·前端·安全·架构·自动化·nps
JavaGuide39 分钟前
DeepSeek Harness 官方桌面端终于有了!
前端·后端
wshzd42 分钟前
LLM之Agent(104)|DeepSeek-Harness(十三)ReactLoopAgent 总览:kick → turn → step
开发语言·前端·javascript
茉莉玫瑰花茶1 小时前
OpenGL [ 基础概念 ]
java·前端·数据库
随性而行3601 小时前
企业微信二次开发如何接入大模型工具?API接口实现智能任务调用的技术思路
java·前端·人工智能·python·微信·机器人·企业微信
IMPYLH1 小时前
HTML 的 <td> 元素
前端·html
gnip1 小时前
Flutter GetX 三件套开发规范(Skill)
前端·flutter
张小姐的猫1 小时前
【AI大模型接入SDK】 —— 前端页面 & 项目总结与拓展
前端·数据结构·数据库·c++·人工智能·chatgpt
web打印社区1 小时前
远程打印:WebSocket 与 HTTP 轮询怎么选
前端·vue.js·websocket·网络协议·http·electron·pdf
吴声子夜歌2 小时前
HTML——庞杂的表单控件元素(一)
前端·html