Skip to content

Commit

Permalink
feat(@angular/cli): add support for custom npmrc paths
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Adam Vigneaux authored and vikerman committed Aug 29, 2019
1 parent a35d908 commit 87b01ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/angular/cli/utilities/package-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ function readOptions(
}

const defaultConfigLocations = [
path.join(globalPrefix, 'etc', baseFilename),
path.join(homedir(), dotFilename),
(!yarn && process.env.NPM_CONFIG_GLOBALCONFIG) || path.join(globalPrefix, 'etc', baseFilename),
(!yarn && process.env.NPM_CONFIG_USERCONFIG) || path.join(homedir(), dotFilename),
];

const projectConfigLocations: string[] = [
Expand Down

0 comments on commit 87b01ff

Please sign in to comment.