Skip to content

ng update fails behind proxy but npm works #20501

@plecos

Description

@plecos

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Description

ng update behind my corporate proxy gives a 407 Authorized only error, but npm works correctly. I have configured npm with both proxy and https-proxy values

🔬 Minimal Reproduction

ng update on my computer

🔥 Exception or Error


An unhandled exception occurred: 407 AuthorizedOnly - GET http://registry.npmjs.org/@angular%2fcli
See "C:\Users\#####\AppData\Local\Temp\ng-PrTzqR\angular-errors.log" for further details.

🌍 Your Environment


Angular CLI: 11.2.6
Node: 14.16.0
OS: win32 x64

Angular: 11.2.7
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1102.6
@angular-devkit/build-angular   0.1102.6
@angular-devkit/core            11.2.6
@angular-devkit/schematics      11.2.6
@angular/cli                    11.2.6
@schematics/angular             11.2.6
@schematics/update              0.1102.6
rxjs                            6.6.6
typescript                      4.1.5

Anything else relevant?
Output of log file mentioned in error:


[error] Error: 407 AuthorizedOnly - GET http://registry.npmjs.org/@angular%2fcli
    at C:\Users\#####\source\repos\ClientApp\node_modules\npm-registry-fetch\check-response.js:123:15
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Object.fetchPackageManifest (C:\Users\#####\source\repos\ClientApp\node_modules\@angular\cli\utilities\package-metadata.js:166:22)
    at async UpdateCommand.checkCLILatestVersion (C:\Users\#####\source\repos\ClientApp\node_modules\@angular\cli\commands\update-impl.js:609:35)
    at async UpdateCommand.run (C:\Users\#####\source\repos\ClientApp\node_modules\@angular\cli\commands\update-impl.js:195:37)
    at async UpdateCommand.validateAndRun (C:\Users\#####\source\repos\ClientApp\node_modules\@angular\cli\models\command.js:139:28)
    at async Object.runCommand (C:\Users\#####\source\repos\ClientApp\node_modules\@angular\cli\models\command-runner.js:204:24)
    at async default_1 (C:\Users\#####\source\repos\ClientApp\node_modules\@angular\cli\lib\cli\index.js:80:31)

Output of npm config list:


; cli configs
metrics-registry = "http://registry.npmjs.org/"
scope = ""
user-agent = "npm/6.14.11 node/v14.16.0 win32 x64"

; userconfig C:\Users\#####\.npmrc
@fortawesome:registry = ""
cache = "c:\\Users\\#####\\npm-cache"
https-proxy = "http://#####@#####:8080/"
prefix = "c:\\Users\\#####\\npm"
proxy = "http://#####@#####:8080/"
registry = "http://registry.npmjs.org/"
strict-ssl = false

; globalconfig c:\Users\#####\npm\etc\npmrc
cache = "c:\\Users\\#####\\npm-cache"
https-proxy = "http://#####@#####:8080/"
prefix = "c:\\Users\\#####\\npm"
proxy = "http://#####@#####:8080/"
registry = "http://registry.npmjs.org/"

; builtin config undefined

; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\Users\#####\source\repos\ClientApp
; HOME = C:\Users\#####
; "npm config ls -l" to show all defaults.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions