【webpack】Error: Cannot find module webpack-cli/bin/config-yargs
程序员文章站
2022-07-12 19:34:00
...
本问题解决方法来自于网友
问题描述
{
"name": "demo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --open webpack --config webpack.config.js",
"build": "webpack --config webpack.config.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.12.3",
"babel-loader": "^8.1.0",
"clean-webpack-plugin": "^3.0.0",
"css-loader": "^5.0.0",
"html-webpack-plugin": "^4.5.0",
"vue": "^2.6.12",
"vue-loader": "^15.9.4",
"vue-style-loader": "^4.1.2",
"vue-template-compiler": "^2.6.12",
"webpack": "^5.3.0",
"webpack-cli": "^4.1.0",
"webpack-dev-server": "^3.11.0"
}
}
npm run build
,ok;npm run start
,不ok,报错如下:
Error: Cannot find module ‘webpack-cli/bin/config-yargs’
解决方法
卸载webpack-cli^4.1.0
,安装webpack-cli 3.*
,比如[email protected]
。
npm uninstall --save-dev webpack-cli
npm install --save-dev [email protected]
上一篇: webpack简单入门
下一篇: OpenNMS通知配置(发送邮件)
推荐阅读
-
【已解决】运行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
-
Error: Cannot find module 'webpack'
-
Error: Cannot find module 'webpack/schemas/WebpackOptions.json'