C:\Users\georg\Desktop\reactapp>npm start
<块引用>
reactapp@1.0.0 启动
webpack-dev-server --hot
node:internal/modules/cjs/loader:927
抛出错误;
^
错误:找不到模块'webpack-cli/bin/config-yargs'
需要堆栈:
- C:\Users\georg\Desktop\reactapp\node_modules\webpack-dev-server\bin\webpack-dev-server.js
在 Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
在 Function.Module._load (node:internal/modules/cjs/loader:769:27)
在 Module.require (node:internal/modules/cjs/loader:996:19)
在要求(节点:内部/模块/cjs/helpers:92:18)
在对象。 (C:\Users\georg\Desktop\reactapp\node_modules\webpack-dev-server\bin\webpack-dev-server.js:65:1)
在 Module._compile (node:internal/modules/cjs/loader:1092:14)
在 Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
在 Module.load (node:internal/modules/cjs/loader:972:32)
在 Function.Module._load (node:internal/modules/cjs/loader:813:14)
在 Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) {
代码:'MODULE_NOT_FOUND',
要求堆栈:[
'C:\Users\georg\Desktop\reactapp\node_modules\webpack-dev-server\bin\webpack-dev-server.js'
]
}
这是上面的错误。
{
"name": "reactapp",
"版本": "1.0.0",
"description": "个人项目",
"main": "index.js",
“脚本”:{
“开始”:“webpack-dev-server --hot”
},
“关键词”:[
"npm",
“个人”,
“项目”
],
"author": "George Ashinze",
"license": "未授权",
“依赖关系”:{
"babel-core": "^6.26.3",
"babel-loader": "^8.2.2",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
“反应”:“^ 17.0.2”,
"react-dom": "^17.0.2",
"webpack": "^5.38.1",
"webpack-dev-server": "^3.11.2"
}
}
这是我上面的 package.json 文件