Skip to content

Commit 87b01ff

Browse files
Adam Vigneauxvikerman
Adam Vigneaux
authored andcommitted
feat(@angular/cli): add support for custom npmrc paths
According to [the npm config docs](https://docs.npmjs.com/misc/config#npmrc-files), a user can specify the path to their `npmrc` files using the environment variables `NPM_CONFIG_USERCONFIG` and `NPM_CONFIG_GLOBALCONFIG`. When set, these variables should override the default paths.
1 parent a35d908 commit 87b01ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/angular/cli/utilities/package-metadata.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ function readOptions(
9191
}
9292

9393
const defaultConfigLocations = [
94-
path.join(globalPrefix, 'etc', baseFilename),
95-
path.join(homedir(), dotFilename),
94+
(!yarn && process.env.NPM_CONFIG_GLOBALCONFIG) || path.join(globalPrefix, 'etc', baseFilename),
95+
(!yarn && process.env.NPM_CONFIG_USERCONFIG) || path.join(homedir(), dotFilename),
9696
];
9797

9898
const projectConfigLocations: string[] = [

0 commit comments

Comments
 (0)