webpack配置自动启动服务时报如下错误

webpack配置自动启动服务时报如下错误,第1张

[webpack-cli] Unable to load '@webpack-cli/serve' command
[webpack-cli] TypeError: options.forEach is not a function
    at WebpackCLI.makeCommand (D:\自学\webpack\change-rows-color\node_modules\webpack-cli\lib\webpack-cli.js:173:21)
    at ServeCommand.apply (D:\自学\webpack\change-rows-color\node_modules\@webpack-cli\serve\lib\index.js:42:19)
    at loadCommandByName (D:\自学\webpack\change-rows-color\node_modules\webpack-cli\lib\webpack-cli.js:907:35)
    at async Command. (D:\自学\webpack\change-rows-color\node_modules\webpack-cli\lib\webpack-cli.js:1462:17)
    at async Promise.all (index 0)
    at async WebpackCLI.run (D:\自学\webpack\change-rows-color\node_modules\webpack-cli\lib\webpack-cli.js:1500:9)
    at async runCLI (D:\自学\webpack\change-rows-color\node_modules\webpack-cli\lib\bootstrap.js:11:9)

这个错误是安装了 npm install webpack-dev-server@3.11.2 -D 然后报错

重新安装一下webpack cli就好了

 npm install webpack-cli -D

 

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/940160.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-17
下一篇 2022-05-17

发表评论

登录后才能评论

评论列表(0条)

保存