diff --git a/cli/src/config.ts b/cli/src/config.ts index f969386d19..75845191f8 100644 --- a/cli/src/config.ts +++ b/cli/src/config.ts @@ -95,6 +95,7 @@ export class Config implements CliConfig { }; platforms: string[] = []; + knownCommunityPlatforms = ['electron']; constructor(os: string, currentWorkingDir: string, cliBinDir: string) { this.initOS(os); diff --git a/cli/src/tasks/add.ts b/cli/src/tasks/add.ts index ad79feb053..b6096c9b8e 100644 --- a/cli/src/tasks/add.ts +++ b/cli/src/tasks/add.ts @@ -36,6 +36,16 @@ export async function addCommand(config: Config, selectedPlatformName: string) { log(result); } else { logError(`platform ${selectedPlatformName} not found`); + + if (config.knownCommunityPlatforms.includes(selectedPlatformName)) { + log( + `Try installing the platform first:\n` + + ` ${chalk.bold( + `npm install @capacitor-community/${selectedPlatformName}`, + )}\n` + + `Then, try adding it again.`, + ); + } } } else { const platformName = await config.askPlatform(