Class constructor ServeCommand cannot be invoked without ‘new‘
作者:互联网
webpack serve
[webpack-cli] Promise rejection: TypeError: Class constructor ServeCommand cannot be invoked without 'new'
[webpack-cli] TypeError: Class constructor ServeCommand cannot be invoked without 'new'
at run (F:\LearnCode\Front-end\MicroFrontend\products\node_modules\webpack-cli\lib\utils\resolve-command.js:33:12)
at Command.<anonymous> (F:\LearnCode\Front-end\MicroFrontend\products\node_modules\webpack-cli\lib\utils\arg-parser
.js:32:58)
at Command.listener [as _actionHandler] (F:\LearnCode\Front-end\MicroFrontend\products\node_modules\webpack-cli\nod
e_modules\commander\index.js:426:31)
at Command._parseCommand (F:\LearnCode\Front-end\MicroFrontend\products\node_modules\webpack-cli\node_modules\comma
nder\index.js:1002:14)
at Command._dispatchSubcommand (F:\LearnCode\Front-end\MicroFrontend\products\node_modules\webpack-cli\node_modules
\commander\index.js:953:18)
at Command._parseCommand (F:\LearnCode\Front-end\MicroFrontend\products\node_modules\webpack-cli\node_modules\comma
nder\index.js:970:12)
at Command.parse (F:\LearnCode\Front-end\MicroFrontend\products\node_modules\webpack-cli\node_modules\commander\ind
ex.js:801:10)
at argParser (F:\LearnCode\Front-end\MicroFrontend\products\node_modules\webpack-cli\lib\utils\arg-parser.js:145:27
)
at parseArgs (F:\LearnCode\Front-end\MicroFrontend\products\node_modules\webpack-cli\lib\bootstrap.js:18:29)
at runCLI (F:\LearnCode\Front-end\MicroFrontend\products\node_modules\webpack-cli\lib\bootstrap.js:24:24)
重新安装 webpack-cli,不指定版本,直接下载最新版。可能是版本过低导致的。
标签:node,invoked,ServeCommand,cli,modules,LearnCode,webpack,cannot,end 来源: https://blog.csdn.net/zulvyinggaitong/article/details/122282744