yarn报错 error Received malformed response from registry ,The registry may be down

4,801 阅读1分钟

yarn 的时候出现错误“error Received malformed response from registry for "ansi-html". The registry may be down.”

解决方法:

// 切换到淘宝镜像源
npm config set registry https://registry.npm.taobao.org 
 npm config set disturl https://npm.taobao.org/dist

原因:可能是当前的源和淘宝的源中不一样,因为淘宝源刷新频率比较频繁,当前源和淘宝源存在差距。可能在当前源中找不到ansi-html这个注册。