解决webpack报错Unable to load ‘@webpack-cli/serve’ command

文章描述:

解决webpack报错Unable to load ‘@webpack-cli/serve’ command

错误

[webpack-cli] Unable to load ‘@webpack-cli/serve’ command
[webpack-cli] TypeError: options.forEach is not a function

 

解决

1.无法加载“@webpack cli/service”命令,未下载@webpack cli/service,则下载webpack cli ( i是 install的简写,-D与 –save-dev的简写,安装包写入 devDependencies(开发环境)中)

npm i --save-dev webpack-cli 

2.查询webpack版本

npx webpack --version

 

发布时间:2022/06/29

发表评论