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

Function getNpmGlobalBinPath

ng-dev/utils/resolve-yarn-bin.ts:118–125  ·  view source on GitHub ↗

Gets the path to the system-wide global NPM binary directory.

()

Source from the content-addressed store, hash-verified

116
117/** Gets the path to the system-wide global NPM binary directory. */
118async function getNpmGlobalBinPath(): Promise<string | null> {
119 try {
120 return (await ChildProcess.spawn('npm', ['bin', '--global'], {mode: 'silent'})).stdout.trim();
121 } catch (e) {
122 Log.debug('Could not determine NPM global binary directory. Error:', e);
123 return null;
124 }
125}
126
127/** Gets the Yarn path from the Yarn configuration if present. */
128async function getYarnPathFromConfigurationIfPresent(projectDir: string): Promise<string | null> {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected