Error: Cannot find module ‘webpack-cli/bin/config-yargs’
程序员文章站
2022-05-13 21:09:45
...
运行npm run dev遇到的问题:
Error: Cannot find module ‘webpack-cli/bin/config-yargs’
// 当前package.json 文件
"devDependencies": {
"webpack": "^5.2.0",
"webpack-cli": "^4.1.0",
"webpack-dev-server": "^3.11.0"
}
解决:
卸载当前的 webpack-cli npm uninstall webpack-cli
安装 webpack-cli 3.* 版本 npm install [email protected] -D
webpack-dev-server ^3 需要安装webpack-cli ^3
// package.json文件
"devDependencies": {
"webpack": "^5.2.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
}
推荐阅读
-
Error: ENOENT: no such file or directory, uv_cwd Error: Cannot find module
-
【已解决】运行webpack-dev-server时提示Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
webpack5: Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
Webpack 报错:Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
webpack-dev-server 报错 Error: Cannot find module ‘webpack/bin/config-yargs‘
-
webpack——Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
【webpack-dev-server】Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
Error: Cannot find module 'webpack-cli/bin/config-yargs' at Function.Module._resolveFilename
-
【webpack】Error: Cannot find module webpack-cli/bin/config-yargs
-
Module build failed: Error: Cannot find module 'node-sass’