晶格点阵
晶格点阵
  • 发布:2024-06-03 15:05
  • 更新:2024-06-03 15:05
  • 阅读:85

【报Bug】执行 npm audit fix --force 后无法启动应用

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Window 11

HBuilderX类型: 正式

HBuilderX版本号: 4.17

浏览器平台: Chrome

浏览器版本: 125.0.6422.141

项目创建方式: HBuilderX

操作步骤:

// 正常
运行:npm run dev:h5
运行: npm audit fix --force
// 报错
运行:npm run dev:h5
运行:npx @dcloudio/uvm@latest
// 正常
运行:npm run dev:h5

预期结果:

报错

实际结果:

报错

bug描述:

运行: npm audit fix --force
再运行:npm run dev:h5


请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。  
vite是按需编译,运行时点击某个未编译页面会先编译后加载,导致显示较慢,发行后无此问题。  
编译器版本:4.15(vue3)  
正在编译中...  
failed to load config from C:\Users\zxstrive\Documents\HBuilderProjects\mulberry-h5\vite.config.js  
error when starting dev server:  
Error: Cannot find module '@dcloudio\uni-mp-kuaishou\lib\uni.plugin.js'  
Require stack:  
- C:\Users\zxstrive\Documents\HBuilderProjects\mulberry-h5\node_modules\@dcloudio\vite-plugin-uni\dist\utils\plugin.js  
- C:\Users\zxstrive\Documents\HBuilderProjects\mulberry-h5\node_modules\@dcloudio\vite-plugin-uni\dist\utils\index.js  
- C:\Users\zxstrive\Documents\HBuilderProjects\mulberry-h5\node_modules\@dcloudio\vite-plugin-uni\dist\configResolved\plugins\static.js  
- C:\Users\zxstrive\Documents\HBuilderProjects\mulberry-h5\node_modules\@dcloudio\vite-plugin-uni\dist\configResolved\plugins\index.js  
- C:\Users\zxstrive\Documents\HBuilderProjects\mulberry-h5\node_modules\@dcloudio\vite-plugin-uni\dist\configResolved\index.js  
- C:\Users\zxstrive\Documents\HBuilderProjects\mulberry-h5\node_modules\@dcloudio\vite-plugin-uni\dist\index.js  
- C:\Users\zxstrive\Documents\HBuilderProjects\mulberry-h5\vite.config.js  
- C:\Users\zxstrive\Documents\HBuilderProjects\mulberry-h5\node_modules\vite\dist\node\chunks\dep-whKeNLxG.js  
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)  
    at Module._resolveFilename (C:\Users\zxstrive\Documents\HBuilderProjects\mulberry-h5\node_modules\module-alias\index.js:49:29)  
    at Function.resolve (node:internal/modules/helpers:190:19)  
    at initPlugin (C:\Users\zxstrive\Documents\HBuilderProjects\mulberry-h5\node_modules\@dcloudio\vite-plugin-uni\dist\utils\plugin.js:63:34)  
    at C:\Users\zxstrive\Documents\HBuilderProjects\mulberry-h5\node_modules\@dcloudio\vite-plugin-uni\dist\utils\plugin.js:72:26  
    at Array.map (<anonymous>)  
    at initPlugins (C:\Users\zxstrive\Documents\HBuilderProjects\mulberry-h5\node_modules\@dcloudio\vite-plugin-uni\dist\utils\plugin.js:72:10)  
    at initExtraPlugins (C:\Users\zxstrive\Documents\HBuilderProjects\mulberry-h5\node_modules\@dcloudio\vite-plugin-uni\dist\utils\plugin.js:59:12)  
    at createPlugins (C:\Users\zxstrive\Documents\HBuilderProjects\mulberry-h5\node_modules\@dcloudio\vite-plugin-uni\dist\index.js:75:53)  
    at uniPlugin (C:\Users\zxstrive\Documents\HBuilderProjects\mulberry-h5\node_modules\@dcloudio\vite-plugin-uni\dist\index.js:48:11)

再运行:npx @dcloudio/uvm@latest
再运行:npm run dev:h5
正常运行

2024-06-03 15:05 负责人:无 分享
已邀请:

要回复问题请先登录注册