pnpm config
别名:c
管理配置文件。
The configuration files are in INI
(the global) and YAML
(the local) formats.
The local configuration file is located in the root of the project and is named pnpm-workspace.yaml
.
全局配置文件位于以下位置之一:
- 如果设置了 $XDG_CONFIG_HOME 环境变量,则为 $XDG_CONFIG_HOME/pnpm/rc
- 在 Windows上:~/AppData/Local/pnpm/config/rc
- 在 macOS 上:~/Library/preferences/pnpm/rc
- 在 Linux上:~/.config/pnpm/rc
命令
set <key> <value>
将配置键设置为提供的值。
get <key>
打印所提供键的配置值。
delete <key>
从配置文件中删除配置键。
list
显示所有配置设置。
配置项
--global, -g
在全局配置文件中设置配置项。
--location
当设置为 project
时,将使用最接近的 package.json
下的 .npmrc
文件。 If no .npmrc
file is present in the directory, the setting will be written to a pnpm-workspace.yaml
file.
当设置为 global
时,性能与设置 --global
选项相同。
--json
以 JSON 格式显示所有的配置设置。