google-gemini/gemini-cli · error · Error
Unsupported install type: ${installMetadata.type}
Error message
Unsupported install type: ${installMetadata.type} What it means
Defensive `default` branch when `installMetadata.type` is not one of `git`, `github-release`, `local`, or `link`. By the time control reaches this branch, the source has not been resolved to a local path. Normal CLI paths only ever produce the four supported types, so this typically indicates a malformed extension-config file or a programmatic caller passing an invalid type.
Source
Thrown at packages/cli/src/config/extension-manager.ts:292
Would you like to attempt to install via "git clone" instead?`,
))
) {
await cloneFromGit(installMetadata, tempDir);
installMetadata.type = 'git';
} else {
throw new Error(
`Failed to install extension ${installMetadata.source}: ${result.errorMessage}`,
);
}
}
localSourcePath = tempDir;
} else if (
installMetadata.type === 'local' ||
installMetadata.type === 'link'
) {
localSourcePath = getRealPath(installMetadata.source);
} else {
throw new Error(`Unsupported install type: ${installMetadata.type}`);
}
try {
newExtensionConfig = await this.loadExtensionConfig(localSourcePath);
const newExtensionName = newExtensionConfig.name;
const previousName = previousExtensionConfig?.name ?? newExtensionName;
const previous = this.getExtensions().find(
(installed) => installed.name === previousName,
);
const nameConflict = this.getExtensions().find(
(installed) =>
installed.name === newExtensionName &&
installed.name !== previousName,
);
if (isUpdate && !previous) {
throw new Error(View on GitHub (pinned to 5024443c72)
Solutions
- Set `installMetadata.type` to one of `git`, `github-release`, `local`, `link` before calling install.
- If migrating from a different install mechanism, re-install through the supported CLI command.
- Delete the on-disk `install_metadata.json` and reinstall from a known source.
Example fix
// before
installOrUpdateExtension({ source: url, type: 'tarball' })
// after
installOrUpdateExtension({ source: localDir, type: 'local' }) Defensive patterns
Strategy: type-guard
Validate before calling
const SUPPORTED = new Set(['git', 'github-release', 'local', 'link']);
if (!SUPPORTED.has(installMetadata.type)) {
throw new Error(`Unsupported install type: ${installMetadata.type}`);
} Type guard
const INSTALL_TYPES = ['git', 'github-release', 'local', 'link'] as const;
type InstallType = (typeof INSTALL_TYPES)[number];
function isInstallType(v: unknown): v is InstallType {
return typeof v === 'string' && (INSTALL_TYPES as readonly string[]).includes(v);
} Prevention
- Constrain `ExtensionInstallMetadata.type` to the supported literal union in your types.
- Validate programmatic inputs before calling the manager.
- Avoid hand-editing `install_metadata.json`.
When it happens
Trigger: Calling `installOrUpdateExtension` directly with a synthetic `ExtensionInstallMetadata` whose `type` is something like `'npm'` or `'tarball'`; a corrupt `install_metadata.json` written by a future or third-party tool.
Common situations: Programmatic use of the ExtensionManager; an extension config produced by an incompatible version; manual edits to on-disk metadata.
Related errors
- Installation aborted: Folder "${absolutePath}" is not truste
- The source argument must be provided.
- Failed to install extension ${installMetadata.source}: ${res
- Extension "${newExtensionName}" is already installed. Please
- Cannot install extension "${newExtensionName}" because a dir
AI-assisted analysis of google-gemini/gemini-cli@5024443c72 (2026-08-12).
Data as JSON: /api/errors/b9b0925f9d4a1003.
Report an issue: GitHub.