查看npm镜像地址
npm config get registry
设置npm镜像地址
npm config set registry http://registry.npm.taobao.org/
同理查看yarn镜像地址
yarn config get registry
设置yarn镜像地址
yarn config set registry http://registry.npm.taobao.org/
本文指导如何查看并设置npm和yarn的默认注册镜像,包括使用`npm config get registry`和`yarn config get registry`获取当前镜像地址,以及如何通过`npm config set registry http://registry.npm.taobao.org/`和`yarn config set registry http://registry.npm.taobao.org/`将镜像切换到中国镜像源。
查看npm镜像地址
npm config get registry
设置npm镜像地址
npm config set registry http://registry.npm.taobao.org/
同理查看yarn镜像地址
yarn config get registry
设置yarn镜像地址
yarn config set registry http://registry.npm.taobao.org/
2355
492
2366

被折叠的 条评论
为什么被折叠?
