INNER CODE UNIT · TypeScript

ensureNpmDependencies

lmstudio-ai/lms · src/subcommands/dev/index.ts:91

async function ensureNpmDependencies(path: string, logger: SimpleLogger, client: LMStudioClient) {
  const packageJson = join(path, "package.json");
  if (!(await exists(packageJson))) {
    logger.error("No package.json found in the plugin folder.");
    process.exit(1);
  }
  if (!(await exists(join(path, "node_modules")))) {
    logger.info("Installing npm dependencies...");
    await client.repository.installPluginDependencies(path);
  } else {
    logger.debug("node_modules already exists. Skipping npm install.");
  }
}

async function handleDevServer(
  projectPath: string,
  manifest: PluginManifest,
  logger: SimpleLogger,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…