错误:找不到模块“webpack-cli/bin/config-yargs" [英] Error: Cannot find module 'webpack-cli/bin/config-yargs'
问题描述
出于安全原因,Github"要求我将webpack-dev-server"更新到 3.1.11 或更高版本.
'Github' asked me to update 'webpack-dev-server' to version 3.1.11 or higher for security reasons.
但是,'npm run dev' 不会在更新后运行.
However, 'npm run dev' will not run after the update.
我不解决这个问题
错误:找不到模块'webpack-cli/bin/config-yargs'
Error: Cannot find module 'webpack-cli/bin/config-yargs'
'package.json' 的代码如下.
The code for 'package.json' is as follows.
"dependencies": {
"@vue/cli-plugin-babel": "^3.5.1",
"config": "^3.0.1",
"vue": "^2.5.2",
"vue-router": "^3.0.1"
},
"devDependencies": {
"vue-jest": "^1.0.2",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.12.0",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.1.14",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
推荐答案
我同意你必须从 webpack
3 升级到 4,但具体来说这些是我必须做的步骤,首先,因为 webpack-cli
已经拆分成一个单独的包:
I agree that you have to upgrade from webpack
3 to 4, but specifically these are the steps I had to do, first, because webpack-cli
has been split out into a separate package:
$ npm install webpack webpack-cli --save-dev
如此处所述:https://webpack.js.org/guides/getting-started/#basic-setup
这篇关于错误:找不到模块“webpack-cli/bin/config-yargs"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!