( projectPath: string, packageManager: 'npm' | 'yarn' | 'pnpm' = 'npm', silent = false )
| 342 | } |
| 343 | |
| 344 | export 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 | |
| 357 | function checkYarnExists(): boolean { |
| 358 | try { |
no test coverage detected