问题:我学习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