angular/angular-cli · warning
Old configuration location detected: ${xdgConfigOld} Please
Error message
Old configuration location detected: ${xdgConfigOld}
Please move the file to the new location ~/.config/angular/config.json What it means
The Angular CLI previously stored global config at `~/.config/angular-cli/config.json` (old XDG path); the location moved to `~/.config/angular/config.json`. When `globalFilePath` finds a file at the old location, it warns the user to move it and continues using the old file for backwards compatibility.
Source
Thrown at packages/angular/cli/src/utilities/config.ts:102
const home = os.homedir();
if (!home) {
return null;
}
// follow XDG Base Directory spec
// note that createGlobalSettings() will continue creating
// global file in home directory, with this user will have
// choice to move change its location to meet XDG convention
const xdgConfig = xdgConfigHome(home, 'config.json');
if (existsSync(xdgConfig)) {
return xdgConfig;
}
// NOTE: This check is for the old configuration location, for more
// information see https://github.com/angular/angular-cli/pull/20556
const xdgConfigOld = xdgConfigHomeOld(home);
if (existsSync(xdgConfigOld)) {
/* eslint-disable no-console */
console.warn(
`Old configuration location detected: ${xdgConfigOld}\n` +
`Please move the file to the new location ~/.config/angular/config.json`,
);
return xdgConfigOld;
}
if (existsSync(defaultGlobalFilePath)) {
return defaultGlobalFilePath;
}
return null;
}
export class AngularWorkspace {
readonly basePath: string;
constructor(View on GitHub (pinned to bb72145f9a)
Solutions
- Move the file: `mkdir -p ~/.config/angular && mv ~/.config/angular-cli/config.json ~/.config/angular/config.json`.
- Remove the stale old directory if a new config already exists: verify contents first, then `rm -rf ~/.config/angular-cli`.
- Re-run the CLI command; the warning should no longer appear.
Example fix
// before (shell) # config lives at ~/.config/angular-cli/config.json // after mkdir -p ~/.config/angular && mv ~/.config/angular-cli/config.json ~/.config/angular/config.json
Defensive patterns
Strategy: validation
Validate before calling
# detect legacy global config before running ng commands [ -f ~/.config/angular-cli/config.json ] && echo "Move it: mv ~/.config/angular-cli/config.json ~/.config/angular/config.json"
Prevention
- After upgrading the CLI, move global config to ~/.config/angular/config.json.
- Exclude the legacy angular-cli path from dotfile sync tools.
- Audit home-dir config paths after major CLI upgrades.
When it happens
Trigger: Any CLI command that reads global configuration (e.g. `ng config`, analytics settings) while `xdgConfigHomeOld(home)` (the pre-rename path) still exists on disk — typically configs created before Angular CLI 12.
Common situations: Upgrading from an old Angular CLI version and keeping home directory files; dotfile-sync/restore tools recreating the legacy path; multi-machine setups with rsynced home directories.
Related errors
- Unsupported package manager: "${name}"
- The configured package manager, '${this.descriptor.binary}',
- Project "${project}" does not exist.
- Project target does not exist.
- A builder is not set for target '${target}' in project '${pr
AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30).
Data as JSON: /api/errors/d2b22a68acda0065.
Report an issue: GitHub.