Vue环境搭建报错整理大全

 更新时间:2022年08月18日 08:53:50   作者:LMGD  
开发中遇到bug是在正常不过了,而程序也基本都是bug堆里爬出来的,对于程序员来说bug调试也是自己工作的重要组成部分,下面这篇文章主要给大家介绍了关于Vue环境搭建报错整理的相关资料,需要的朋友可以参考下

错1: 执行 cnpm install / npm install 报错如下

× Install fail! Error: [tui-editor@1.3.3 › tui-chart@3.11.3 › raphael@git+https://github.com/nhn/raphael.git#2.2.0-c] An unknown git error occurred
Error: [tui-editor@1.3.3 › tui-chart@3.11.3 › raphael@git+https://github.com/nhn/raphael.git#2.2.0-c] An unknown git error occurred
    at module.exports (C:\Users\LMGD\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\lib\download\git.js:36:11)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async module.exports (C:\Users\LMGD\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\lib\download\index.js:17:12)
    at async _install (C:\Users\LMGD\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\lib\install.js:125:16)
    at async install (C:\Users\LMGD\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\lib\install.js:26:12)
    at async mapper (C:\Users\LMGD\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\lib\install.js:266:9)

 解决:

办法1:降低node.js版本

1、开始以为是镜像源连接不上,换成淘宝镜像也不行。

2、node.js卸载多次,重新安装也不行。百度的方法都试过也不行。最后最后最后,降低node.js版本,问题解决。

3、node.js 原本使用的版本是 node-v16.13.0-x64 卸载重新安装 node-v12.9.0-x64 即可。(只是解决了这个问题而已,其他问题还是需要百度)

办法2:降低版本依旧报错,执行相关命令

Error: [tui-editor@1.3.3 › tui-chart@3.11.3 › raphael@git+https://github.com/nhn/raphael.git#2.2.0-c] An unknown git error occurred
    at module.exports (C:\Users\LMGD\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\lib\download\git.js:36:11)
    at processTicksAndRejections (internal/process/task_queues.js:85:5)

 解决:执行如下命令即可

npm install cnpm -g --registry=https://registry.npm.taobao.org

效果截图:

报错2:core-js 缺失问题

 npm install --save core-js/modules/es.regexp.dot-all.js core-js/modules/es.typed-array.at.js

 解决:core-js 缺失问题,首先安装core-js ;运行:npm install core-js@2

npm install core-js@2

报错3: Connection was aborted, errno 10053

OpenSSL SSL_read: Connection was aborted, errno 10053

原因: Git默认限制推送的大小,运行命令更改限制大小即可

解决: 执行命令 :git config --global http.postBuffer 524288000

git config --global http.postBuffer 524288000

报错4:npm ERR! git@github.com: Permission denied (publickey)

npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 128
npm ERR! npm ERR! An unknown git error occurred
npm ERR! npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/adobe-webplatform/eve.git
npm ERR! npm ERR! git@github.com: Permission denied (publickey).
npm ERR! npm ERR! fatal: Could not read from remote repository.
npm ERR! npm ERR!
npm ERR! npm ERR! Please make sure you have the correct access rights
npm ERR! npm ERR! and the repository exists.

 解决:本地重新生成 publickey,然后在github上配置key即可

错误5:Error: Cannot find module 'webpack' 问题解决办法

解决:没找到webpack模块安装webpack模块,执行命令 npm install --save-dev webpack

npm install --save-dev webpack

错误6: wanda-admin@4.4.0 dev: `vue-cli-service serve`

解决:使用淘宝镜像,执行如下命令即可

npm install cnpm -g --registry=https://registry.npm.taobao.org

错误7:Error: Cannot find module '@vue/cli-plugin-babel'

Error: Cannot find module '@vue/cli-plugin-babel'
Require stack:
- C:\Users\LMGD\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\Service.js
- C:\Users\LMGD\AppData\Roaming\npm\node_modules\@vue\cli-service\bin\vue-cli-service.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
    at Function.Module._load (internal/modules/cjs/loader.js:677:27)
    at Module.require (internal/modules/cjs/loader.js:830:19)
    at require (internal/modules/cjs/helpers.js:68:18)
    at idToPlugin (C:\Users\LMGD\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\Service.js:145:14)
    at C:\Users\LMGD\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\Service.js:184:20
    at Array.map (<anonymous>)
    at Service.resolvePlugins (C:\Users\LMGD\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\Service.js:170:10)
    at new Service (C:\Users\LMGD\AppData\Roaming\npm\node_modules\@vue\cli-service\lib\Service.js:32:25)
    at Object.<anonymous> (C:\Users\LMGD\AppData\Roaming\npm\node_modules\@vue\cli-service\bin\vue-cli-service.js:15:17) {

 解决:缺少 @vue/cli-plugin-babel 安装即可。执行命令:npm install @vue/cli-plugin-babel

npm install @vue/cli-plugin-babel

错误8:vue-cli · Failed to download repo vuejs-templates/webpack: read ECONNRESET

输入初始化项目命令 vue init webpack xxx项目名; 后报错
报错信息:
vue-cli · Failed to download repo vuejs-templates/webpack: read ECONNRESET 

解决: 这是网络问题,切换好一点的网络即可解决;

切换网络后的效果图:

总结 

到此这篇关于Vue环境搭建报错整理的文章就介绍到这了,更多相关Vue环境搭建报错内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

相关文章

  • Vue实现浏览器打印功能的代码

    Vue实现浏览器打印功能的代码

    这篇文章主要介绍了Vue实现浏览器打印功能,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
    2020-04-04
  • vue3.0 setup中使用vue-router问题

    vue3.0 setup中使用vue-router问题

    这篇文章主要介绍了vue3.0 setup中使用vue-router问题,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
    2022-10-10
  • Vue路由跳转的4种方式小结

    Vue路由跳转的4种方式小结

    本文主要介绍了Vue路由跳转的4种方式小结,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2022-06-06
  • Vue 3 进阶用法之异步组件

    Vue 3 进阶用法之异步组件

    为了解决加载组件中出现的报错、超时、状态展示等问题,可以使用 Vue 3 提供的异步组件(Async Components),它对于加载过程做了更细致的控制,这篇文章主要介绍了Vue 3 进阶用法之异步组件,需要的朋友可以参考下
    2024-04-04
  • 完美解决axios跨域请求出错的问题

    完美解决axios跨域请求出错的问题

    下面小编就为大家分享一篇完美解决axios跨域请求出错的问题,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
    2018-02-02
  • vue使用axios的小技巧分享

    vue使用axios的小技巧分享

    这篇文章主要为大家详细介绍了一些vue使用axios的小技巧,文中的示例代码讲解详细,对我们深入掌握vue有一定的帮助,感兴趣的小伙伴可以跟随小编一起学习一下
    2023-10-10
  • 详解vue3中组件的非兼容变更

    详解vue3中组件的非兼容变更

    这篇文章主要介绍了详解vue3中组件的非兼容变更,帮助大家更好的理解和学习使用vue框架,感兴趣的朋友可以了解下
    2021-03-03
  • vue实现扫码功能

    vue实现扫码功能

    这篇文章主要为大家详细介绍了vue实现扫码功能,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2020-01-01
  • Vue中添加过渡效果的方法

    Vue中添加过渡效果的方法

    本篇文章主要介绍了Vue中添加过渡效果的方法,Vue 在插入、更新或者移除 DOM 时,提供多种不同方式的应用过渡效果,有兴趣的同学可以了解一下。
    2017-03-03
  • element如何初始化组件功能详解

    element如何初始化组件功能详解

    Element UI是一套基于Vue的桌面端组件库,封装好了很多常用的UI组件,下面这篇文章主要给大家介绍了关于element如何初始化组件功能的相关资料,文中通过示例代码介绍的非常详细,需要的朋友可以参考下
    2022-12-12

最新评论