MCPcopy Create free account
hub / github.com/angular/dev-infra / getYarnPathFromNpmGlobalBinaries

Function getYarnPathFromNpmGlobalBinaries

ng-dev/utils/resolve-yarn-bin.ts:104–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102
103/** Gets the path to the Yarn binary from the NPM global binary directory. */
104export 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. */
118async function getNpmGlobalBinPath(): Promise<string | null> {

Callers 1

Calls 2

getNpmGlobalBinPathFunction · 0.85
whichFunction · 0.50

Tested by

no test coverage detected