Stories

Detail Return Return

記錄一次vue-cli創建vue項目失敗,一直卡着不動問題 - Stories Detail

問題描述:使用 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 Avatar lyflexi Avatar lishisan Avatar wanglinfeng Avatar coderleo Avatar
Favorites 5 users favorite the story!
Favorites

Add a new Comments

Some HTML is okay.