问题描述:使用 vue create a-test 命令创建项目一直卡着安装依赖失败,报错:ERROR Failed to get response from https://registry.npm.taobao.org/binary-mirror-config,命令行出现如下信息:

Failed to check for updates
✨ Creating project in E:\work\a-test123.
🗃 Initializing git repository...
⚙️ Installing CLI plugins. This might take a while...

ERROR Failed to get response from https://registry.npm.taobao.org/binary-mirror-config
[#########.........] - idealTree:@types/webpack-sources: sill fetch manifest picomatch@^2.0.4

vue-cli创建vue项目报错信息

vue-cli版本:v4.5.15、v4.5.12

问题原因:vue-cli 4.xx 版本后默认启用了淘宝镜像源,而npm的镜像源不是淘宝的(npm config get registry命令可以查看npm镜像源)

解决办法:修改全局的.vuerc文件的useTaobaoRegistryfalse即可
image.png

.vuerc文件所在位置

  • Windows系统:C盘下的用户目录,如:C:\Users\xxx
    image.png
  • MacOS系统:home目录下,如:/home/xxx

heath_learning
1.4k 声望31 粉丝