diff --git a/packages/cli/src/commands/install/install.ts b/packages/cli/src/commands/install/install.ts index f60201a174..bd3a05ebc1 100644 --- a/packages/cli/src/commands/install/install.ts +++ b/packages/cli/src/commands/install/install.ts @@ -155,12 +155,13 @@ async function loadPeerPluginDeps( } export default async (pluginId?: string, cmd?: Command) => { + const from = pluginId || cmd?.from; // TODO(himanshu): If no plugin id is provided, it should list all plugins available. Maybe in some other command? - if (!pluginId && !cmd?.from) { + if (!from) { throw new Error( 'Missing both or a package.json file path in the --from flag.', ); } - const pkg = await loadPackageJson(pluginId || cmd?.from); + const pkg = await loadPackageJson(from); await installPluginAndPeerPlugins(pkg); };