动态

详情 返回 返回

記錄一次vue-cli創建vue項目失敗,一直卡着不動問題 - 动态 详情

問題描述:使用 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
user avatar lufeidexiao 头像 lyflexi 头像 lishisan 头像 wanglinfeng 头像 coderleo 头像
点赞 5 用户, 点赞了这篇动态!
点赞

Add a new 评论

Some HTML is okay.