{"record":{"id":"315e855173416ddb","repo":"angular/angular-cli","slug":"setup-completed-successfully-but-there-does-not-s-315e85","errorCode":null,"errorMessage":"Setup completed successfully, but there does not seem to be a global install of the Angular CLI. For autocompletion to work, the CLI will need to be on your `$PATH`, which is typically done with the `-g` flag in `npm install -g @angular/cli`.\n\nFor more information, see https://angular.dev/cli/completion#global-install","messagePattern":"Setup completed successfully, but there does not seem to be a global install of the Angular CLI\\. For autocompletion to work, the CLI will need to be on your `\\$PATH`, which is typically done with the `-g` flag in `npm install -g @angular/cli`\\.\n\nFor more information, see https://angular\\.dev/cli/completion#global-install","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/angular/cli/src/utilities/completion.ts","lineNumber":86,"sourceCode":"  } catch (err) {\n    assertIsError(err);\n    // Failed to set up autocompeletion, log the error and abort.\n    logger.error(err.message);\n\n    return 1;\n  }\n\n  // Notify the user autocompletion was set up successfully.\n  logger.info(\n    `\nAppended \\`source <(ng completion script)\\` to \\`${rcFile}\\`. Restart your terminal or run the following to autocomplete \\`ng\\` commands:\n\n    ${colors.yellow(`source <(ng completion script)`)}\n    `.trim(),\n  );\n\n  if (!(await hasGlobalCliInstall())) {\n    logger.warn(\n      'Setup completed successfully, but there does not seem to be a global install of the' +\n        ' Angular CLI. For autocompletion to work, the CLI will need to be on your `$PATH`, which' +\n        ' is typically done with the `-g` flag in `npm install -g @angular/cli`.' +\n        '\\n\\n' +\n        'For more information, see https://angular.dev/cli/completion#global-install',\n    );\n  }\n\n  // Save configuration to remember that the user was prompted.\n  await setCompletionConfig({ ...completionConfig, prompted: true });\n\n  return undefined;\n}\n\nasync function getCompletionConfig(): Promise<CompletionConfig | undefined> {\n  const wksp = await getWorkspace('global');\n\n  return wksp?.getCli()?.['completion'];","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/utilities/completion.ts#L68-L104","documentation":"After `ng completion` sets up autocompletion, the CLI checks whether the Angular CLI is installed globally. If not, it warns that the `ng` binary likely isn't on `$PATH` globally, so shell autocompletion cannot work reliably, and points to the completion docs.","triggerScenarios":"Running `ng completion` (or commands that trigger `considerSettingUpAutocompletion`) when `hasGlobalCliInstall()` returns false — i.e. `@angular/cli` was installed locally via `npm install @angular/cli` (no `-g`) or run via `npx`.","commonSituations":"Project-local CLI installs, using `npx @angular/cli`, monorepo setups where the CLI is a devDependency, or global installs under a Node version manager whose binary isn't on the login shell's PATH.","solutions":["Install the CLI globally: `npm install -g @angular/cli`, then re-run `ng completion`.","Ensure the global npm bin directory is on your `$PATH` (`npm config get prefix` / `npm bin -g`).","Source the completion script in your shell profile if a global install exists but isn't detected: `source <(ng completion script)`."],"exampleFix":"// before\nnpm install @angular/cli\nng completion\n// after\nnpm install -g @angular/cli\nng completion","handlingStrategy":"validation","validationCode":"// verify global CLI before setting up completion\nconst globalCli = require('child_process').execSync('npm ls -g @angular/cli --depth=0').toString();\nif (!globalCli.includes('@angular/cli')) console.warn('Install globally: npm i -g @angular/cli');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install the CLI globally (`npm i -g @angular/cli`) on dev machines.","Ensure npm's global bin dir is on `$PATH`.","Avoid relying on `npx` runs for autocompletion setup."],"tags":["autocomplete","shell","angular-cli","installation"],"backgroundTag":"cli-not-on-path","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}