執行yarn命令報錯解決方案“error An unexpected error occurred: "https://registry.npm.taobao.org/”


  1. 因為yarn的源是

    https://registry.npm.taobao.org
    
  2. 而npm的源是

    https://registry.npm.org
    
  3. 查看npm的源

    npm config get registry
    
  4. 修改npm源
    方法一:

    npm config set registry https://registry.npm.taobao.org
    npm config set disturl https://npm.taobao.org/dist
    

    方法二:

    yarn config set registry https://registry.npm.taobao.org/
    yarn config set disturl https://npm.taobao.org/dist
    yarn config set sass-binary-site https://npm.taobao.org/mirrors/node-sass
    
  5. 添加 yarn源

    yarn add taobao https://registry.npm.taobao.org/
    
  6. 代理問題:

    yarn config rm proxy
    yarn config  rm https-proxy
    


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM