{"record":{"id":"d2b22a68acda0065","repo":"angular/angular-cli","slug":"old-configuration-location-detected-xdgconfigol","errorCode":null,"errorMessage":"Old configuration location detected: ${xdgConfigOld}\nPlease move the file to the new location ~/.config/angular/config.json","messagePattern":"Old configuration location detected: (.+?)\nPlease move the file to the new location ~/\\.config/angular/config\\.json","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/angular/cli/src/utilities/config.ts","lineNumber":102,"sourceCode":"  const home = os.homedir();\n  if (!home) {\n    return null;\n  }\n\n  // follow XDG Base Directory spec\n  // note that createGlobalSettings() will continue creating\n  // global file in home directory, with this user will have\n  // choice to move change its location to meet XDG convention\n  const xdgConfig = xdgConfigHome(home, 'config.json');\n  if (existsSync(xdgConfig)) {\n    return xdgConfig;\n  }\n  // NOTE: This check is for the old configuration location, for more\n  // information see https://github.com/angular/angular-cli/pull/20556\n  const xdgConfigOld = xdgConfigHomeOld(home);\n  if (existsSync(xdgConfigOld)) {\n    /* eslint-disable no-console */\n    console.warn(\n      `Old configuration location detected: ${xdgConfigOld}\\n` +\n        `Please move the file to the new location ~/.config/angular/config.json`,\n    );\n\n    return xdgConfigOld;\n  }\n\n  if (existsSync(defaultGlobalFilePath)) {\n    return defaultGlobalFilePath;\n  }\n\n  return null;\n}\n\nexport class AngularWorkspace {\n  readonly basePath: string;\n\n  constructor(","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/utilities/config.ts#L84-L120","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before (shell)\n# config lives at ~/.config/angular-cli/config.json\n// after\nmkdir -p ~/.config/angular && mv ~/.config/angular-cli/config.json ~/.config/angular/config.json","handlingStrategy":"validation","validationCode":"# detect legacy global config before running ng commands\n[ -f ~/.config/angular-cli/config.json ] && echo \"Move it: mv ~/.config/angular-cli/config.json ~/.config/angular/config.json\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["configuration","xdg","migration","angular-cli"],"backgroundTag":"deprecated-config-location","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}