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

  1. Move the file: `mkdir -p ~/.config/angular && mv ~/.config/angular-cli/config.json ~/.config/angular/config.json`.
  2. Remove the stale old directory if a new config already exists: verify contents first, then `rm -rf ~/.config/angular-cli`.
  3. 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

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


AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30). Data as JSON: /api/errors/d2b22a68acda0065. Report an issue: GitHub.