创建vue3项目运行npm create vue@latest报错

问题:我学习vue3的时候刚开始创建项目的时候就有问题了,一开始是卡住一动不动

排查问题: 一开始卡住不动的时候先看下自己的node.js是否是15版本以上的,因为vue3,只支持在node.js 版本在15以上的,一般都会重新安装最新的版本,需要注意的是安装完node 后要重启下电脑.

 在安装完最新版本后就会有这个报错

PS D:\desktop> npm create vue@latest
npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/create-vue failed, reason: connect ETIMEDOUT 104.16.31.34:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in: C:\Users\初心\AppData\Local\npm-cache\_logs\2024-04-10T01_52_43_780Z-debug-0.log

问题排查:发现是npm镜像的问题,旧的镜像使用的是

https://registry.npm.taobao.org/

把镜像指令更改下就可以了

npm config set registry=https://registry.npmmirror.com
Windows PowerShell
版权所有(C) Microsoft Corporation。保留所有权利。

安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows

PS D:\desktop> npm create vue@latest
npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/create-vue failed, reason: connect ETIMEDOUT 104.16.31.34:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in: C:\Users\初心\AppData\Local\npm-cache\_logs\2024-04-10T01_52_43_780Z-debug-0.log
PS D:\desktop> npm config set registry=https://registry.npmmirror.com
PS D:\desktop> npm create vue@latest
Need to install the following packages:
create-vue@3.10.2

思路来源于创建vue3项目运行npm create vue@latest报错

  • 7
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值