Class constructor ServeCommand cannot be invoked without ‘new‘

本文讲述了遇到 'TypeError: ClassConstructorServeCommand cannot be invoked without 'new'' 错误时,通过重新安装最新版webpack-cli来修复的问题,适合前端开发者解决Webpack serve启动问题。
摘要由CSDN通过智能技术生成
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,不指定版本,直接下载最新版。可能是版本过低导致的。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值