skip to content
声控烤箱 | KazooTTT 博客

npm换源

Updated:

摘要(由llm生成)

本文介绍了如何查看、更换和取消Node.js包管理工具(npm, yarn, pnpm)的源地址,以及如何使用yrm工具快速切换不同的npm源。通过执行特定的命令,用户可以轻松地管理这些工具的源设置,从而优化包的下载速度和开发效率。

查看源

Terminal window
npm config get registry
Terminal window
yarn config get registry
Terminal window
pnpm config get registry

换源

Terminal window
npm config set registry https://registry.npmmirror.com
Terminal window
yarn config set registry https://registry.npmmirror.com
Terminal window
pnpm config set registry https://registry.npmmirror.com

取消换源

Terminal window
npm config delete registry
Terminal window
yarn config delete registry
Terminal window
pnpm config delete registry

工具

GitHub - i5ting/yrm: YARN registry manager, fast switch between different registries: npm, cnpm, nj, taobao

Terminal window
npm install -g yrm
yrm ls
yrm use [name]
感谢阅读到这里,期待收到更多的反馈
欢迎关注公众号
kazoottt
公众号二维码