webpack - 从 webpack-cli 获取错误:TypeError: merge.smart is not a function
问题描述
当我这样做时出现错误yarn build
,我收到此错误:
TypeError: merge.smart is not a function
at Object.<anonymous> (/var/www/html/Dragons/PROJETPERSO/PORTFOLIO/config/webpack.prod.js:9:24)
at Module._compile (/var/www/html/Dragons/PROJETPERSO/PORTFOLIO/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Module.require (internal/modules/cjs/loader.js:1040:19)
at require (/var/www/html/Dragons/PROJETPERSO/PORTFOLIO/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
at WEBPACK_OPTIONS (/var/www/html/Dragons/PROJETPERSO/PORTFOLIO/node_modules/webpack-cli/bin/utils/convert-argv.js:114:13)
at requireConfig (/var/www/html/Dragons/PROJETPERSO/PORTFOLIO/node_modules/webpack-cli/bin/utils/convert-argv.js:116:6)
at /var/www/html/Dragons/PROJETPERSO/PORTFOLIO/node_modules/webpack-cli/bin/utils/convert-argv.js:123:17
at Array.forEach (<anonymous>)
at module.exports (/var/www/html/Dragons/PROJETPERSO/PORTFOLIO/node_modules/webpack-cli/bin/utils/convert-argv.js:121:15)
at /var/www/html/Dragons/PROJETPERSO/PORTFOLIO/node_modules/webpack-cli/bin/cli.js:71:45
at Object.parse (/var/www/html/Dragons/PROJETPERSO/PORTFOLIO/node_modules/yargs/yargs.js:576:18)
at /var/www/html/Dragons/PROJETPERSO/PORTFOLIO/node_modules/webpack-cli/bin/cli.js:49:8
at Object.<anonymous> (/var/www/html/Dragons/PROJETPERSO/PORTFOLIO/node_modules/webpack-cli/bin/cli.js:366:3)
at Module._compile (internal/modules/cjs/loader.js:1151:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Module.require (internal/modules/cjs/loader.js:1040:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/var/www/html/Dragons/PROJETPERSO/PORTFOLIO/node_modules/webpack/bin/webpack.js:156:2)
at Module._compile (internal/modules/cjs/loader.js:1151:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 error Command failed with exit code 1.
有没有人有任何想法来解决我的问题?
PS:我的 webpack 版本是 4.44.2
解决方案
尝试将版本降低到 4.2.1
推荐阅读
- python - django xhtml2pdf没有得到图像
- javascript - 如何在 Oracle Apex 5 中使用 javascript 从表格中获取选定的行(及其值)
- ssl - ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1108)
- facebook - 从帖子中查找每个反应的计数
- sql - 嵌套 (?) SQL 查询
- ios - URLSession downloadTask(with:) 创建多个文件下载
- javascript - Javascript InnerHtml 来自
- reactjs - 无法将反应应用程序部署到谷歌应用程序引擎
- angular - 只为包输出和运行测试构建一次 Angular 9 项目
- javascript - 在 Angular 中打开新项目时折叠已经消耗的项目