Tag Archives: [webpackcli] Unable to load’@webpackcli/serve’command

[Solved] Webpack Error: [webpack-cli] Unable to load ‘@webpack-cli/serve’ command

To facilitate development and debugging, install webpack dev server

Webpack dev server allows webpack to monitor changes in project source code for automatic packaging and construction.

Install webpack dev server

npm install [email protected] -D

After installation, execute NPM run dev to report an error!

[webpack-cli] Unable to load ‘@webpack-cli/serve’ command

[webpack-cli] TypeError: options.forEach is not a function

Read the report incorrectly, which means that “[webpack cli] cannot load the” @ webpack cli/serve “command”. I think it should be installed if the webpack cli cannot be loaded.

Solution:

Execute the following command:

npm install webpack-cli --save-dev

Then Run npm run dev

okay~