博客 / 詳情

返回

記錄一次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 lanlanjintianhenhappy 頭像 huishou 頭像 sunhengzhe 頭像 chenychenyu 頭像 pangsir8983 頭像 lidalei 頭像 tofrankie 頭像 fyuanlove 頭像 clearlove07 頭像 tempest_619c7f9d4e321 頭像 zhengcaiyunqianduantuandui 頭像 delai 頭像
25 位用戶收藏了這個故事!

發佈 評論

Some HTML is okay.