Webpack-cli: Error: Cannot find module 'webpack-cli/bin/config-yargs'

Created on 15 Oct 2020  路  11Comments  路  Source: webpack/webpack-cli

If you upgrade webpack to 5. *, and webpack cli to 4. *, an error will be reported:

Error: Cannot find module 'webpack-cli/bin/config-yargs'

Temporary solution:
Back off webpack cli to version 3. * for example:

"webpack-cli": "^ 3.3.12"

Bug

Most helpful comment

Is it an event similar to this?
webpack/webpack-dev-server#2759

Yes, thank you. It has been solved. My configuration is as follows:

 "start": "webpack serve --progress --color --config webpack/dev.js"

 "webpack": "^5.1.0",
 "webpack-cli": "^4.0.0",
 "webpack-dev-server": "^3.11.0",

All 11 comments

Is it an event similar to this?
webpack/webpack-dev-server#2759

Yes, thank you. It has been solved. My configuration is as follows:

 "start": "webpack serve --progress --color --config webpack/dev.js"

 "webpack": "^5.1.0",
 "webpack-cli": "^4.0.0",
 "webpack-dev-server": "^3.11.0",

Please use search before creating issues

Pinned

Pinned

I want to say, that webpack-cli removed yargs package from version4.0.0 but existed in version3.3.12, so if someone want to use webpack-dev-server and its hot refresh, he can revert to v3.3.12, I'm sure it will be ok, not related to versions of webpack or webpack-dev-server.But I don't know why the author removed yargs package.

"dev": "webpack server --progress --color --config ./config/webpack.dev.ts",

Error:
```
脳 Webpack
Compiled with some errors in 237.76ms

(node:9504) [DEP_WEBPACK_TEMPLATE_PATH_PLUGIN_REPLACE_PATH_VARIABLES_HASH] DeprecationWarning: [hash] is now [fullhash] (also consider using [chunkhash] or [contenthash], see documentation for details)
(Use node --trace-deprecation ... to show where the warning was created)
(node:9504) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.
[webpack-cli] Compilation finished
ERROR in main
Module not found: Error: Can't resolve 'server' in 'E:\WebProject\WebCAD'
````

@FishOrBear command is webpack serve

@evilebottnawi I've looked through a few of these issues and am a bit confused. Is using webpack serve instead of webpack-dev-server a temporary workaround or is this going to be the new way to start webpack dev server?

@sacummings91

@evilebottnawi I've looked through a few of these issues and am a bit confused. Is using webpack serve instead of webpack-dev-server a temporary workaround or is this going to be the new way to start webpack dev server?

It is new way to run webpack-dev-server

Sorry for delay

change from "start": "webpack-dev-serve --open", to "start": "webpack serve --open",

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sam-s4s picture sam-s4s  路  5Comments

larkintuckerllc picture larkintuckerllc  路  5Comments

billyjanitsch picture billyjanitsch  路  3Comments

heyalbert picture heyalbert  路  3Comments

snitin315 picture snitin315  路  5Comments