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)
I've had a similar problem. I think it's related to webpack version. After changing webpack version the latest everything was fine...
I also go this error when I had only installed
webpack
locally and hadn't installed it globally yet.I had
webpack-dev-server
installed globally though and it had a dependency on a global install ofwebpack
. To be fair npm did complain while installingwebpack-dev-server
: