跳到主内容

webpack打包报错 ERROR in Error Child compilation failed

· 1分钟阅读

问题

在 webpack 运行报错,ERROR in Error: Child compilation failed: Cannot find module 'xxx'

原因

缺少相关依赖包 xxx,通过 npm 安装即可

解决

比如错误信息如下

Cannot find module 'handlebars'

安装包即可

npm i handlebars --save-dev