Error report:
The CLI moved into a separate package: webpack-cli.
Please install 'webpack-cli' in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D
module.js:442
throw err;
^
Error: Cannot find module 'webpack-cli/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 Object. (D:[email protected]@webpack-dev-serverbinwebpack-dev-server.js:6
5:1)
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)
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run
" "server"
npm ERR! node v6.2.1
npm ERR! npm v3.9.3
npm ERR! code ELIFECYCLE
npm ERR! @ server: `webpack-dev-server --open`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ server script 'webpack-dev-server --open'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack-dev-server --open
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:wabgnpm-debug.log
The reason:
Webpack is not compatible with the webpack-dev-server version, resulting in a compilation error.
Solution:
Uninstall and reinstall with the following command:
Uninstall version:
cnpm uninstall webpack -g or npm uninstall webpack -g
cnpm uninstall -g webpack-dev-server or npm uninstall -g webpack-dev-server
Install the specified version
cnpm install [email protected] --save-dev or npm install [email protected] --save-dev
cnpm install [email protected] --save -dev or npm install [email protected] --save -dev
Read More:
- webpack4 Use webpack-dev-server Error [How to Solve]
- [Solved] Webpack compilation Error: Cannot find module’webpack-cli/bin/config-yargs’
- How to Fix Node SASS Error in Vue + webpack project after nodejs upgrade
- How to Solve NPM run dev error: missing script:dev
- How to Solve Error: Cannot find module ‘webpack/lib/RequestShortener’
- How to Solve Webpack CacheGroups Error
- [Solved] Error: Cannot find module ‘webpack-cli/package.json‘
- How to Solve webpack -v View Error in vsode
- When starting Vue project: cannot find module ‘webpack cli / bin / config yargs’ error resolution
- [Solved] Webpack error static heartbeat interval = 1000
- NPM start project error: cannot find module ‘webpack’ problem solution
- Error: cannot find module ‘webpack cli/bin/config yargs’‘
- Some problems encountered in the initial construction of Ant Design Pro project, such as cross Env, webpack and so on
- Webpack packaging error TypeError: this.getOptions is not a function at Object.lessLoader
- Webpack Error: Module build failed: TypeError: this.getOptions is not a function
- Cssssyntax error in webpack [How to Solve]
- How to Fix Microsoft SQL Server Error 1326
- [Solved] webpack.config.js configuration encountered Error: Cannot find module’@babel/core’&&Cannot find module’@babel/plugin-transform-react-jsx’
- Webpack Pack and compress ES6 files with errors: ERROR in js/xxxxxx.js from UglifyJs Unexpected token punc ()
- How to Fix Failed to load resource: the server responded with a status of 404()