执行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