angular/angular-cli · warning
Setup completed successfully, but there does not seem to be
Error message
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`. For more information, see https://angular.dev/cli/completion#global-install
What it means
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.
Source
Thrown at packages/angular/cli/src/utilities/completion.ts:86
} catch (err) {
assertIsError(err);
// Failed to set up autocompeletion, log the error and abort.
logger.error(err.message);
return 1;
}
// Notify the user autocompletion was set up successfully.
logger.info(
`
Appended \`source <(ng completion script)\` to \`${rcFile}\`. Restart your terminal or run the following to autocomplete \`ng\` commands:
${colors.yellow(`source <(ng completion script)`)}
`.trim(),
);
if (!(await hasGlobalCliInstall())) {
logger.warn(
'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\n' +
'For more information, see https://angular.dev/cli/completion#global-install',
);
}
// Save configuration to remember that the user was prompted.
await setCompletionConfig({ ...completionConfig, prompted: true });
return undefined;
}
async function getCompletionConfig(): Promise<CompletionConfig | undefined> {
const wksp = await getWorkspace('global');
return wksp?.getCli()?.['completion'];View on GitHub (pinned to bb72145f9a)
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)`.
Example fix
// before npm install @angular/cli ng completion // after npm install -g @angular/cli ng completion
Defensive patterns
Strategy: validation
Validate before calling
// verify global CLI before setting up completion
const globalCli = require('child_process').execSync('npm ls -g @angular/cli --depth=0').toString();
if (!globalCli.includes('@angular/cli')) console.warn('Install globally: npm i -g @angular/cli'); Prevention
- 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.
When it happens
Trigger: 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`.
Common situations: 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.
Related errors
- `$SHELL` environment variable not set. Angular CLI autocompl
- Unknown `$SHELL` environment variable value (${shell}). Angu
- Could not find ${level} workspace.
- Invalid config found at ${workspace.filePath}. CLI should be
- Could not find a ${level} workspace. Are you in a project?
AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30).
Data as JSON: /api/errors/315e855173416ddb.
Report an issue: GitHub.