npm config
管理 npm 配置
语法
npm config <子命令> [选项]说明
npm config 命令用于查看和修改 npm 的配置项(如 registry、cache 目录等)。
参数
get读取配置项
set设置配置项
list列出所有配置
delete删除配置项
-g操作全局配置
示例
查看 registry
查看当前使用的镜像源
npm config get registry切换到淘宝镜像
临时切换到国内镜像加速
npm config set registry https://registry.npmmirror.com列出配置
显示所有生效的配置项
npm config list