import { getVersionList, MinecraftVersion, install } from "@xmcl/installer";
import { MinecraftLocation } from "@xmcl/core";
const minecraft: MinecraftLocation;
const { versions } = await getVersionList();
const aVersion: MinecraftVersion = versions[0]; // i just pick the first version in list here
await install(aVersion, minecraft);
or as an option: