Node.js 项目通过 .npmrc 文件指定依赖安装源

背景

npm 命令运行时,往往通过命令行指定相关配置,最常用的便是使用 --registry 来指定依赖的安装源。

npm install --registry=https://registry.npmmirror.com

同样的效果也可以使用 .npmrc 来实现:

registry=https://registry.npmmirror.com

"Node.js 项目通过 .npmrc 文件指定依赖安装源"继续阅读