查看基本配置
npm config list
查看所有配置
npm config list -l
查看当前下载地址
npm get registry
临时生效修改npm下载的地址(国内淘宝镜像地址)
npm --registry https://registry.npm.taobao.org install express
永久生效修改npm下载的地址(国内淘宝镜像地址)
npm config set registry https://registry.npm.taobao.org
切换回默认的源
npm config set registry https://registry.npmjs.org
npm 安装包路径配置
npm config set cache "D:\xxx\xxx\node_global"
npm 缓存路径配置
npm config set prefix "D:\xxx\xxx\npm_cache"
本文详细介绍了如何临时和永久设置npm的下载地址为国内淘宝镜像,切换默认源,以及配置npm的安装路径和缓存路径。适合开发者快速提升npm包下载速度和管理效率。
13万+

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



