Skip to content

ng add --registry not working #16766

@SansDK

Description

@SansDK

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • add
  • e2e
  • generate
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Unsure, probably not.

Description

When trying to install a package with ng add from a local npm registry, using ng add package-name --registry=http://localhost:4873/ (Verdaccio in my case), ng add seems to ignore the --registry parameter and continues to try and pull the package from the registry url set in npm config.

If I set the npm registry to localhost manually, ng add works fine.
npm config set registry http://localhost:4873

Previous issue which asked for this feature: #14189.
PR which supposedly added this feature: #14285.

🔬 Minimal Reproduction

Prerequisites:

  • Have Verdaccio or any other private / local npm registry running.
  • Have some package published in the private registry.

Steps:

  1. Generate new Angular project with ng new.
  2. Run ng add package-name --registry=http://localhost:4873, replace package name and url with your own.
  3. It will now throw an error because it can't find the package on https://registry.npmjs.org/, obviously.

🔥 Exception or Error

An unhandled exception occurred: npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/package-name - Not found
npm ERR! 404
npm ERR! 404  'package-name@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

🌍 Your Environment

Angular CLI: 8.3.23
Node: 13.0.1
OS: win32 x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.23
@angular-devkit/build-angular     0.803.23
@angular-devkit/build-optimizer   0.803.23
@angular-devkit/build-webpack     0.803.23
@angular-devkit/core              8.3.23
@angular-devkit/schematics        8.3.23
@angular/cli                      8.3.23
@ngtools/webpack                  8.3.23
@schematics/angular               8.3.23
@schematics/update                0.803.23
rxjs                              6.4.0
typescript                        3.5.3
webpack                           4.39.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions