Getting error when running webpack-dev-server --config config/webpack.dev.js --progress --profile --watch --content-base src/
. Here is the error log:
module.js:442
throw err;
^
Error: Cannot find module 'webpack/bin/config-yargs'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
Try changing webpack version to 3.0 and web-dev-server to 2.7.1
Eg:
Update your Webpack version (and webpack CLI):
If you don't use one of those mentioned above, feel free to omit.
these worked for me:
I forgot to install webpack-cli. So I ran below command and issue got fixed.
I have used these dependencies Working for me.
The general situation is due to Webpack and webpack-dev-server version is not compatible. Like I also have this problem, my computer's webpack is 1.15.0, but webpack-dev-server is 2.x above version. So I uninstall webpack-dev-server: npm uninstall webpack-dev-server -g Then install the 1.15.0 version of webpack-dev-server, you can solve this problem by npm install webpack-dev-server@1.15.0 -g