{"record":{"id":"ed07d393cf773e5e","repo":"angular/angular-cli","slug":"invalid-path","errorCode":null,"errorMessage":"Invalid Path.","messagePattern":"Invalid Path\\.","errorType":"validation","errorClass":"CommandModuleError","httpStatus":null,"severity":"error","filePath":"packages/angular/cli/src/commands/config/cli.ts","lineNumber":97,"sourceCode":"      ? jsonFile.get(parseJsonPath(options.jsonPath))\n      : jsonFile.content;\n\n    if (value === undefined) {\n      logger.error('Value cannot be found.');\n\n      return 1;\n    } else if (typeof value === 'string') {\n      logger.info(value);\n    } else {\n      logger.info(JSON.stringify(value, null, 2));\n    }\n\n    return 0;\n  }\n\n  private async set(options: Options<ConfigCommandArgs>): Promise<number | void> {\n    if (!options.jsonPath?.trim()) {\n      throw new CommandModuleError('Invalid Path.');\n    }\n\n    const [config, configPath] = await getWorkspaceRaw(options.global ? 'global' : 'local');\n    const { logger } = this.context;\n\n    if (!config || !configPath) {\n      throw new CommandModuleError('Confguration file cannot be found.');\n    }\n\n    const normalizeUUIDValue = (v: string | undefined) => (v === '' ? randomUUID() : `${v}`);\n\n    const value =\n      options.jsonPath === 'cli.analyticsSharing.uuid'\n        ? normalizeUUIDValue(options.value)\n        : options.value;\n\n    const modified = config.modify(parseJsonPath(options.jsonPath), normalizeValue(value));\n","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/commands/config/cli.ts#L79-L115","documentation":"The `ng config` command's set() method writes a value into angular.json (or the global .angular-config) at a JSON path supplied via --json-path. If the path option is missing or only whitespace, it throws CommandModuleError('Invalid Path.') because there is nothing to target.","triggerScenarios":"Running `ng config` set without the jsonPath argument (`ng config cli.defaultCollection` with no path), or passing an empty/whitespace-only path (`ng config \" \" value`).","commonSituations":"Shell quoting errors that drop the argument; scripting the command with a variable that resolves to empty string; typos like forgetting the key entirely while only passing a value.","solutions":["Pass a full JSON path, e.g. `ng config cli.defaultCollection \"@angular/scss\"` or `ng config schematics.@schematics/angular.component.style scss`","If using a shell variable, verify it is non-empty before invoking: echo \"$PATH_VAR\"","Check quoting so the path isn't consumed by the shell","Use `ng config --help` to confirm the expected argument order"],"exampleFix":"// before\nng config \"\" newvalue\n// after\nng config cli.defaultCollection newvalue","handlingStrategy":"validation","validationCode":"if (!jsonPath || !jsonPath.trim()) {\n  throw new CommandModuleError('Invalid Path.');\n}\nawait ngConfigSet(jsonPath, value);","typeGuard":"function isValidJsonPathInput(p: string | undefined | null): p is string {\n  return typeof p === 'string' && p.trim().length > 0;\n}","tryCatchPattern":"try {\n  await configCommand.run({ jsonPath: myPath, value } as any);\n} catch (e) {\n  if (e instanceof CommandModuleError && e.message === 'Invalid Path.') {\n    logger.error('Usage: ng config <json-path> <value>');\n  } else { throw e; }\n}","preventionTips":["Quote JSON paths in the shell to prevent argument dropping","Validate script variables are non-empty before invoking ng config","Always pass path before value in argument order","Sanitize user-supplied config paths with trim() before use"],"tags":["angular-cli","config","cli-arguments"],"backgroundTag":"missing-required-argument","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}