> Login@1.0.0 dev D:\迅雷下载\code\52323Vue.js前端开发实战-源代码\20201201\Login > webpack-dev-server --inline --hot --port 8088 internal/modules/cjs/loader.js:583 throw err; ^ Error: Cannot find module 'webpack-cli/bin/config-yargs' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (D:\迅雷下载\code\52323Vue.js前端开发实战-源代码\20201201\Login\node_modules\webpack-dev-server\bin\webpack-dev-server.js:65:1) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! Login@1.0.0 dev: `webpack-dev-server --inline --hot --port 8088` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the Login@1.0.0 dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\aieye\AppData\Roaming\npm-cache\_logs\2023-05-25T09_52_31_654Z-debug.log
时间: 2024-02-06 08:08:58 浏览: 58
这个错误提示是说在运行webpack-dev-server时找不到'webpack-cli/bin/config-yargs'这个模块。解决方法是先安装webpack-cli模块:
```
npm install webpack-cli -g
```
然后在项目中安装webpack-cli模块:
```
npm install webpack-cli --save-dev
```
安装完成后再重新运行webpack-dev-server命令即可。
相关问题
Login@1.0.0 dev D:\迅雷下载\code\52323Vue.js前端开发实战-源代码\20201201\Login > webpack-dev-server --inline --hot --port 8088 internal/modules/cjs/loader.js:583 throw err; ^ Error: Cannot find module 'webpack-cli/bin/config-yargs' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (D:\迅雷下载\code\52323Vue.js前端开发实战-源代码\20201201\Login\node_modules\webpack-dev-server\bin\webpack-dev-server.js:65:1) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! Login@1.0.0 dev: `webpack-dev-server --inline --hot --port 8088` npm ERR! Failed at the Login@1.0.0 dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\aieye\AppData\Roaming\npm-cache\_logs\2023-05-25T09_55_22_614Z-debug.log
这是一个错误信息,提示无法找到 'webpack-cli/bin/config-yargs' 模块。可能是因为你没有安装 webpack-cli 或者没有正确配置 webpack-dev-server。你可以尝试在命令行中运行以下命令进行安装:
```
npm install webpack-cli -g
```
如果已经安装了 webpack-cli,可以尝试卸载并重新安装来解决问题。另外,你还可以检查 webpack-dev-server 的配置文件是否正确。如果遇到问题,可以查看 npm 日志以获取更多信息。
> vue-ele-project@1.0.0 dev > webpack-dev-server --inline --progress --config build/webpack.dev.conf.js 'webpack-dev-server' 不是内部或外部命令,也不是可运行的程序 或批处理文件。
这是一个错误提示,可能是因为你没有安装 webpack-dev-server 或者没有添加到环境变量中。你可以尝试使用 npm install webpack-dev-server 来安装 webpack-dev-server,或者检查一下操作系统的环境变量配置。
阅读全文