create-nitro-lib
Version:
CLI tool to generate React Native Nitro Modules templates
17 lines (16 loc) • 639 B
JavaScript
import { execSync } from 'node:child_process';
import { detectPackageManager, getInstallCommand, } from '../utils/packageManager.js';
export async function installDependencies(projectDir) {
const packageManager = detectPackageManager();
const installCommand = getInstallCommand(packageManager);
try {
console.log(`Installing dependencies with ${packageManager}...`);
execSync(installCommand, {
cwd: projectDir,
stdio: 'inherit',
});
}
catch (error) {
console.warn(`Failed to install dependencies automatically. Please run '${installCommand}' manually.`);
}
}