错误如下所示:

 ERROR  Failed to compile with 1 error                                                                                                                                                                     下午11:40:17error  in ./src/components/ProductParam.vue?vue&type=script&lang=js&Module not found: Error: Can't resolve 'process' in 'E:\mooc\vueMallsystem\mimall\src\components'BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.If you want to include a polyfill, you need to:- add a fallback 'resolve.fallback: { "process": require.resolve("process/browser") }'- install 'process'
If you don't want to include a polyfill, you can use an empty module like this:resolve.fallback: { "process": false }

检查下来是因为 webpack 5 以前的版本包含 polyfills。错误信息也给出了这个原因。
解决办法:

安装依赖

npm install path-browserify

vue.config.js中配置

const NodePolyfillPlugin = require("node-polyfill-webpack-plugin")configureWebpack:  {resolve: {fallback: {fs: false,crypto: require.resolve("crypto-browserify")}},plugins: [new NodePolyfillPlugin()],},

BREAKING CHANGE: webpack < 5 used to include polyfills for nod相关推荐

  1. BREAKING CHANGE: webpack < 5 used to include polyfills

    解决webpack5错误,类似下面这种错误信息 BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core m ...

  2. 修改 Angular Component 构造函数参数被认为是 breaking change

    修改构造函数参数被认为是 breaking change: Making any changes to the class constructor signature. Note that super ...

  3. 关于 SAP 电商云 Spartacus UI 修改 div 层级结果是否算是 breaking change 的问题

    这里理论上也可以连续点击,每次点击产生一个 HTTP PUT 请求: 修改之后: 修改之前: Changing anything that affects the rendering of the e ...

  4. #include <filename> 和 #include “filename“ 有什么区别?

    问: 在 include 指令中使用尖括号和引号有什么区别? #include <文件名> #include "文件名" 答1: huntsbot.com全球7大洲远程 ...

  5. 避免修改构造函数输入参数引起的 breaking change

    本文记录我在工作中的一次失误. 如下图所示,我在构造函数里注入了一个新的依赖: protected checkoutService: CheckoutService 当下列情况同时满足时,客户就会遇到 ...

  6. SAP 电商云 Spartacus UI 出现 breaking change 时,如何用文字来描述

    用文字描述 html 文件的变化: In attribute cxPopoverOptions of element button.hint-popover property displayClose ...

  7. git下载,上传代码到GitLab ; Untracked files (use “git add <file>...“ to include in what will be committed)

    环境:Windows10 git版本:git-2.12.2.2-64-bit.exe 安装git,安装成功文件夹上右键,菜单中会有git GUI here 及git Bash here选项 使用: 1 ...

  8. vue中webpack5版本报错If you want to include a polyfill you need , If you don‘t want to include a polyfill

    错误提示 BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. ...

  9. Module not found: Error: Can‘t resolve ‘path‘

    环境 Node.js版本 $ node -v v16.14.0 依赖包 package.json {"name": "vue-print","vers ...

最新文章

  1. python处理pdf实例_Python实战-从菜鸟到大牛的进阶之路pdf_Python教程
  2. 《大数据分析原理与实践》——小结
  3. myeclipse文件目录自动定位(右编辑界面点击 左边Package Explorer导航自动定位)...
  4. 数据库的优化tips
  5. Shell 脚本中如何使用make命令
  6. 计算机网络65535,计算机网络1
  7. 1650显卡和1050T显卡差距大吗?
  8. P3032 [USACO11NOV]二进制数独Binary Sudoku
  9. R语言︱噪声数据处理、数据分组——分箱法(离散化、等级化)
  10. MVC – 5.MVC设计模式和.NetMVC框架
  11. 使用 Python爬虫+OpenCV 通过摄像头 二维码识别 来得到官方接口的反馈数据 从而实现实时准确地 检测健康码状态(获取JS动态数据)
  12. php公众号模板在哪,微信公众号模板哪里找?公众号如何套用模板?
  13. 用matlab解根3乘根2,信号与系统第五章习题答案
  14. V831编译提示 virtual memory exhausted: Cannot allocate memory 解决方法
  15. 【SpringBoot深入浅出系列】SpringBoot之实现支付宝扫码支付(沙箱环境编码实现)
  16. 【STL】push 和 emplace区别
  17. 《汇编语言》王爽(第四版) 第十章 实验10
  18. 揭秘美国云计算 大企业是第一推动力
  19. 算法手撕代码1~10
  20. 【Seagate】希捷12代盘状态忙的修复流程

热门文章

  1. DVI和HDMI的EDID设计小结
  2. 2009.10.18 OA 项目组一周工作报告
  3. php停车场系统设计,基于PHP的停车场管理系统设计与实现
  4. Java面试中常问的数据库方面问题
  5. 给第一行单元格赋值 + WPS JS获取工作表的总行数 + WPS JS获取工作表的总行数
  6. Java 根据IP获取城市(ip2region)
  7. Java利用ShutDownHook关闭系统资源
  8. 手写YOLOv3|代码详细注释
  9. 十大iOS塔防游戏评点
  10. NILM非侵入式负荷识别(papers with code、data)带代码的论文整理——(公开数据集、工具、和性能指标篇) 全网最全