Linux command
ng-config 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Get a configuration value
ng config [jsonPath]
Set a configuration value
ng config [jsonPath] [value]
Get the schematic collections
ng config cli.schematicCollections
Set the default package manager
ng config cli.packageManager [npm|yarn|pnpm]
Get global configuration value
ng config --global [jsonPath]
Show all project configuration
ng config
说明
ng config reads and writes values in the Angular workspace configuration file (angular.json). Configuration values are accessed using JSON path dot notation. When only a path is provided, the current value is displayed. When a value is also provided, the configuration is updated. This command is useful for scripting Angular workspace setup and for inspecting or modifying build configurations, default schematics, and CLI behavior.
参数
- --global, -g
- Access the global Angular CLI configuration instead of the project-level angular.json.
- --help
- Display help information.
FAQ
What is the ng-config command used for?
ng config reads and writes values in the Angular workspace configuration file (angular.json). Configuration values are accessed using JSON path dot notation. When only a path is provided, the current value is displayed. When a value is also provided, the configuration is updated. This command is useful for scripting Angular workspace setup and for inspecting or modifying build configurations, default schematics, and CLI behavior.
How do I run a basic ng-config example?
Run `ng config [jsonPath]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --global, -g do in ng-config?
Access the global Angular CLI configuration instead of the project-level angular.json.