1.设置为淘宝镜像
npm config set registry https://registry.npm.taobao.org
2.设置回原本的源,用来发布npm包
npm config set registry https://registry.npmjs.org
3.查看npm当前设置的源
npm config get registry 或者 npm config list
这篇博客介绍了如何在npm中切换配置源,包括将源设置为淘宝镜像以加速包下载,以及如何切换回官方源进行npm包的发布。通过`npm config set registry`命令,可以轻松管理npm的registry设置,查看当前源则使用`npm config get registry`或`npm config list`。这对于开发者优化包管理效率和确保发布流程正确性至关重要。
1.设置为淘宝镜像
npm config set registry https://registry.npm.taobao.org
2.设置回原本的源,用来发布npm包
npm config set registry https://registry.npmjs.org
3.查看npm当前设置的源
npm config get registry 或者 npm config list
5870
247
1万+
223

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