{"record":{"id":"8aeabfb0cafd23dc","repo":"angular/angular-cli","slug":"setup-completed-successfully-but-there-does-not-s","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/commands/completion/cli.ts","lineNumber":51,"sourceCode":"    try {\n      rcFile = await initializeAutocomplete();\n    } catch (err) {\n      assertIsError(err);\n      this.context.logger.error(err.message);\n\n      return 1;\n    }\n\n    this.context.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()) === false) {\n      this.context.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    return 0;\n  }\n}\n\nclass CompletionScriptCommandModule extends CommandModule implements CommandModuleImplementation {\n  command = 'script';\n  describe = 'Generate a bash and zsh real-time type-ahead autocompletion script.';\n  longDescriptionPath = undefined;\n\n  builder(localYargs: Argv): Argv {","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular/cli/src/commands/completion/cli.ts#L33-L69","documentation":"The `ng completion` command warns that autocompletion was set up (sourcing lines added to the shell RC), but the running `ng` binary does not appear to be a global npm install. For completion to work at runtime the CLI must be on $PATH, which the global install normally provides.","triggerScenarios":"Running `ng completion` (or accepting its setup prompt) while the CLI was installed locally via `npm install @angular/cli` or via npx, so hasGlobalCliInstall() returns false.","commonSituations":"Projects with @angular/cli only as a devDependency; using `npx @angular/cli` without a global install; using a package manager (pnpm/yarn) whose global layout isn't detected by the check.","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`).","See https://angular.dev/cli/completion#global-install for setup details."],"exampleFix":"// before\nnpx @angular/cli completion\n// warning: no global install\n// after\nnpm install -g @angular/cli\nng completion","handlingStrategy":"validation","validationCode":"import { execSync } from 'node:child_process';\nconst prefix = execSync('npm config get prefix').toString().trim();\nconst onPath = process.env.PATH?.split(':').includes(`${prefix}/bin`);\nif (!onPath) console.warn('Global npm bin not on $PATH; run `npm install -g @angular/cli`.');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install the CLI globally with `npm install -g @angular/cli` before running `ng completion`.","Ensure the npm global bin directory is on $PATH.","Avoid invoking completion setup through npx or local devDependency binaries."],"tags":["angular-cli","completion","global-install","path"],"backgroundTag":"cli-not-on-path","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}