npm-config

概要

npm config set <key> <value> [-g|--global]
npm config get <key>
npm config delete <key>
npm config list [-l] [--json]
npm config edit
npm get <key>
npm set <key> <value> [-g|--global]

aliases: c

描述

该npm config命令可用于更新和编辑用户和全局npmrc文件的内容。

子命令

Config支持以下子命令:

set
> npm config set <key> <value>

给上面key设置value,如果省略了value,则将其设置为“true”。

get
> npm config get <key>

获取key对应的值。

list
> npm config list

显示所有已设置的配置项。使用-l还会显示有默认的值的配置项。使用--json 以json格式显示。

delete
> npm config delete <key>

把设置的key从所有配置文件中删除。

edit
> npm config edit

打开配置文件。若使用--global,则会打开全局配置文件。

results matching ""

    No results matching ""