Files
kazoottt-blog/src/content/post/npm换源.md
2025-01-07 15:27:11 +00:00

1.1 KiB
Raw Blame History

title, date, author, tags, published, slug, description, category, toAstro
title date author tags published slug description category toAstro
npm换源 2024-02-07 KazooTTT
npm
node
true npm-registry 本文介绍了如何查看、更换和取消Node.js包管理工具npm, yarn, pnpm的源地址以及如何使用yrm工具快速切换不同的npm源。通过执行特定的命令用户可以轻松地管理这些工具的源设置从而优化包的下载速度和开发效率。 前端 true

查看源

npm config get registry
yarn config get registry
pnpm config get registry

换源

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

取消换源

npm config delete registry
yarn config delete registry
pnpm config delete registry

工具

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

npm install -g yrm

yrm ls

yrm use [name]