(name)
| 117 | } |
| 118 | |
| 119 | function resolveBinary(name) { |
| 120 | const packageJsonPath = require.resolve(`${name}/package.json`) |
| 121 | const binaryPath = path.join(path.dirname(packageJsonPath), "bin", sourceBinary) |
| 122 | if (!fs.existsSync(binaryPath)) throw new Error(`Binary not found at ${binaryPath}`) |
| 123 | return binaryPath |
| 124 | } |
| 125 | |
| 126 | function installPackage(name) { |
| 127 | const version = packageJson.optionalDependencies?.[name] |