()
| 102 | |
| 103 | /** Gets the path to the Yarn binary from the NPM global binary directory. */ |
| 104 | export async function getYarnPathFromNpmGlobalBinaries(): Promise<string | null> { |
| 105 | const npmGlobalBinPath = await getNpmGlobalBinPath(); |
| 106 | if (npmGlobalBinPath === null) { |
| 107 | return null; |
| 108 | } |
| 109 | try { |
| 110 | return await which('yarn', {path: npmGlobalBinPath}); |
| 111 | } catch (e) { |
| 112 | Log.debug('Could not find Yarn within NPM global binary directory. Error:', e); |
| 113 | return null; |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | /** Gets the path to the system-wide global NPM binary directory. */ |
| 118 | async function getNpmGlobalBinPath(): Promise<string | null> { |
no test coverage detected