Error: Cannot find module ‘webpack/bin/config-yargs‘ at Function.Module._resolveFilename (intern

简介: Error: Cannot find module ‘webpack/bin/config-yargs‘ at Function.Module._resolveFilename (intern

🌷🍁 博主猫头虎 带您 Go to New World.✨🍁

🦄 博客首页——猫头虎的博客🎐

🐳《面试题大全专栏》 文章图文并茂🦕生动形象🦖简单易学!欢迎大家来踩踩~🌺

🌊 《IDEA开发秘籍专栏》学会IDEA常用操作,工作效率翻倍~💐

🌊 《100天精通Golang(基础入门篇)》学会Golang语言,畅玩云原生,走遍大小厂~💐

🪁🍁 希望本文能够给您带来一定的帮助🌸文章粗浅,敬请批评指正!🍁🐥


错误日志

D:\ideaproject\vue-cli>npm run dev
> vue-cli@1.0.0 dev D:\ideaproject\vue-cli
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
internal/modules/cjs/loader.js:583
    throw err;
    ^
Error: Cannot find module 'webpack/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:\ideaproject\vue-cli\node_modules\webpack-dev-server\bin\webpack-dev-server.js:54: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! vue-cli@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-cli@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\Administrator\AppData\Roaming\npm-cache\_logs\2022-11-17T07_54_21_888Z-debug.log

npm 、cnpm 、node、vue 全都装上了,就是 webpack 装不上!!

解答:版本兼容问题

查看node.js版本

node -v

切换镜像命令

npm config set registry http://registry.npm.taobao.org/

查看镜像命令

npm get registry

步骤一:卸载旧版本

npm uninstall webpack -g   // 卸载webpack
npm uninstall webpack-dev-server // 卸载webpack-dev-server

步骤二:安装指定版本

npm install webpack@3.8.0 --save-dev
npm install webpack-dev-server@2.9.7 --save-dev

总结:

最后执行npm run dev就可以**Compiled successfully.**啦

D:\ideaproject\vue-cli>npm run dev
> vue-cli@1.0.0 dev D:\ideaproject\vue-cli
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
 12% building modules 23/31 modules 8 active ...=0!D:\ideaproject\vue-cli\src\App.vue{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }.
 95% emitting
 DONE  Compiled successfully in 4104ms                                                                                                                                                             15:58:03
 I  Your application is running here: http://localhost:8080

结语

如果这篇文章对您有所帮助,或者有所启发的话,求一键三连:点赞、评论、收藏➕关注,您的支持是我坚持写作最大的动力。

原创声明

======= ·

  • 原创作者: 猫头虎

作者wx: [ libin9iOak ]

学习 复习

本文为原创文章,版权归作者所有。未经许可,禁止转载、复制或引用。

作者保证信息真实可靠,但不对准确性和完整性承担责任

未经许可,禁止商业用途。

如有疑问或建议,请联系作者。

感谢您的支持与尊重。

点击下方名片,加入IT技术核心学习团队。一起探索科技的未来,共同成长。


目录
相关文章
|
7月前
|
API C++
【Azure 环境】VS Code登录China Azure(Function)报错 An error occurred while signing in: invalid_request - AADSTS65002
An error occurred while signing in: invalid_request - AADSTS65002: Consent between first party application 'c27c220f-ce2f-4904-927d-333864217eeb' and first party resource '797f4846-ba00-4fd7-ba43-dac1f8f63013' must be configured via preauthorization - applications owned and operated by Microsoft mus
362 13
|
Java Windows
【Azure Function】部署Java Function失败:报错deploy [ERROR] Status code 401和警告 'China North 3' may not be a valid region
1:deploy [ERROR] Status code 401, (empty body). 2: China North 3 may not be a valid region,please refer to https://aka.ms/maven_function_configuration#supported-regions for values. 3:  <azure.functions.maven.plugin.version>1.36.0</azure.functions.maven.plugin.version>
330 11
解决微软云Azure Function运行报错-Value cannot be null. (Parameter ‘provider‘)
解决微软云Azure Function运行报错-Value cannot be null. (Parameter ‘provider‘)
372 4
|
TensorFlow API 算法框架/工具
【Tensorflow】解决Inputs to eager execution function cannot be Keras symbolic tensors, but found [<tf.Te
文章讨论了在使用Tensorflow 2.3时遇到的一个错误:"Inputs to eager execution function cannot be Keras symbolic tensors...",这个问题通常与Tensorflow的eager execution(急切执行)模式有关,提供了三种解决这个问题的方法。
201 1
|
JavaScript
Vue 开发中的一些问题简单记录,Cannot find module ‘webpack/lib/RuleSet‘
Vue 开发中的一些问题简单记录,Cannot find module ‘webpack/lib/RuleSet‘
1184 1
|
前端开发
Error in created hook: “TypeError: _test.default is not a function
Error in created hook: “TypeError: _test.default is not a function
|
C++ Python
【Azure 应用服务】Azure Function Python函数部署到Azure后遇见 Value cannot be null. (Parameter 'receiverConnectionString') 错误
【Azure 应用服务】Azure Function Python函数部署到Azure后遇见 Value cannot be null. (Parameter 'receiverConnectionString') 错误
228 0
|
Python
【Azure 应用服务】Azure Function HTTP Trigger 遇见奇妙的500 Internal Server Error: Failed to forward request to http://169.254.130.x
【Azure 应用服务】Azure Function HTTP Trigger 遇见奇妙的500 Internal Server Error: Failed to forward request to http://169.254.130.x
272 0
【Azure 应用服务】Azure Function 启用 Managed Identity后, Powershell Funciton出现 ERROR: ManagedIdentityCredential authentication failed
【Azure 应用服务】Azure Function 启用 Managed Identity后, Powershell Funciton出现 ERROR: ManagedIdentityCredential authentication failed
299 0
|
JavaScript 前端开发 C++
【Azure Function】调试 VS Code Javascript Function本地不能运行,报错 Value cannot be null. (Parameter 'provider')问题
【Azure Function】调试 VS Code Javascript Function本地不能运行,报错 Value cannot be null. (Parameter 'provider')问题
208 0