MCPcopy
hub / github.com/subquery/subql / installDependencies

Function installDependencies

packages/cli/src/controller/init-controller.ts:344–355  ·  view source on GitHub ↗
(
  projectPath: string,
  packageManager: 'npm' | 'yarn' | 'pnpm' = 'npm',
  silent = false
)

Source from the content-addressed store, hash-verified

342}
343
344export function installDependencies(
345 projectPath: string,
346 packageManager: 'npm' | 'yarn' | 'pnpm' = 'npm',
347 silent = false
348): void {
349 if (packageManager === 'yarn' && !checkYarnExists()) {
350 packageManager = 'npm';
351 }
352 const command = `${packageManager} install`;
353
354 childProcess.execSync(command, {cwd: projectPath, stdio: silent ? 'ignore' : undefined});
355}
356
357function checkYarnExists(): boolean {
358 try {

Callers 1

initAdapterFunction · 0.90

Calls 1

checkYarnExistsFunction · 0.85

Tested by

no test coverage detected