我正在尝试将 webpack 与 webpack-dev-server 一起运行,但出现此错误:
TypeError: Cannot destructure property `logger` of 'undefined' or 'null'.
at Object.<anonymous> (/Users/monz777/test/node_modules/@webpack-cli/serve/lib/createConfig.js:4:34)
at Module._compile (/Users/monz777/test/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Module.require (internal/modules/cjs/loader.js:723:19)
at require (/Users/monz777/test/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
at Object.<anonymous> (Users/monz777/test/node_modules/@webpack-cli/serve/lib/startDevServer.js:6:40)
at Module._compile (/Users/monz777/test/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
版本:
"webpack": "^4.42.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3",
NPM 脚本:
"start": "webpack serve --open --config webpack.config.js",
在最新版本上尝试相同,但没有帮助。