Skip to content

ng update ignores project .npmrc registry #27163

Open
@samwootton

Description

@samwootton

Command

update

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I have a project level .npmrc with
registry=https://registry.npmjs.org/
and a user level .npmrc with
registry=https://example-company-private-repo.org/

As described here https://docs.npmjs.com/cli/v10/configuring-npm/npmrc project level config should override user level config. The output of npm config:

; "user" config from /Users/sam.wootton/.npmrc
; registry = "https://example-company-private-repo.org/" ; overridden by project
; "project" config from /Users/sam.wootton/devspace/personal/ngstuff/myproject/.npmrc
registry = "https://registry.npmjs.org/" 
; "cli" config from command line options

Minimal Reproduction

ng update (with different registry in .npmrc at the user and project level).
I've removed node_modules (to ensure no packages from the user level registry)

Exception or Error

Running ng update, the user level registry is used and the project level one is ignored:

ng update @angular/core@16 @angular/cli@17                                       
The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 16.2.12 to perform the update.
npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to https://company-private-repo.org/@angular%2fcli failed, reason: getaddrinfo ENOTFOUND company-private-repo.org
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'


### Your Environment

Angular CLI: 15.2.10
Node: 16.15.0
Package Manager: npm 8.5.5
OS: darwin arm64

Angular:
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.1502.10 (cli-only)
@angular-devkit/build-angular
@angular-devkit/core 15.2.10 (cli-only)
@angular-devkit/schematics 15.2.10 (cli-only)
@angular/cli 15.2.10 (cli-only)
@schematics/angular 15.2.10 (cli-only)
rxjs 6.6.7 (cli-only)
typescript



### Anything else relevant?

_No response_

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions