Closed diyfr closed 2 years ago
Hi, I tried this out and global npmrc is being read.
ng add baz
Unable to fetch package metadata: request to https://myregistry/repository/myrepo/baz failed, reason: getaddrinfo ENOTFOUND myregistry **myregistry:443**
Can you kindly check where your global npmrc is being saved?
We need a real repository @alan-agius4 . myregistry
is an example.
For resolve this issue i added registry
ng add @angular/pwa --registry=https://myregistry/repository/myrepo/
and it's work
In user directory, the file .npmrc contains credentials for registry, but not registry address.
The registry address is stored in %APPDATA%\roaming\npm\etc\npmrc
Location documentation
with ng update --registry=....
doesn't work
We have the same problem with @angular/cli 9.1.0.
The command ng update @angular/core
produces
An unhandled exception occurred: request to https://registry.npmjs.org/@angular%2fcli failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org
even though our global npmrc specifies our company npm-registry - Output of npm config list
is
; builtin config undefined cache = "C:\Users\t196\AppData\Local\npm-cache" prefix = "C:\Users\t196\AppData\Local\npm-global" registry = "https://nexus.mycompany.com/repository/npm-all/"
; node bin location = C:\Program Files\nodejs\12.13.1\node.exe ; cwd = C:\Workspaces\my-app\ui
Btw, if the global npmrc
is copied to the app working directory (.npmrc) the ng update
command works correcly using our company registry, so a local config seems to be honored (but a global one should be too).
We have the inverse issue. Our local .npmrc
is ignored but if we copy the local file as user config it works.
The config contains the local registry and root certificate of our company:
$ ls .npmrc
.npmrc
$ ng update --verbose
Locating potential npmrc files:
Trying 'C:\Program Files\nodejs\etc\npmrc'...not found.
Trying 'D:\Users\user\.npmrc'...not found.
Trying 'D:\Users\.npmrc'...not found.
Trying 'D:\Users\user\.npmrc'...not found.
Trying 'D:\Users\user\projects\.npmrc'...not found.
Trying 'D:\Users\user\projects\angular\.npmrc'...found.
The installed local Angular CLI version is older than the latest stable version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.
An unhandled exception occurred: npm ERR! code SELF_SIGNED_CERT_IN_CHAIN
npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN
npm ERR! request to https://registry.npmjs.org/@angular%2fcli failed, reason: self signed certificate in certificate chain
[SNIP]
$ cp .npmrc ~/.npmrc
$ ng update --verbose
Locating potential npmrc files:
Trying 'C:\Program Files\nodejs\etc\npmrc'...not found.
Trying 'D:\Users\user\.npmrc'...found.
Trying 'D:\Users\.npmrc'...not found.
Trying 'D:\Users\user\.npmrc'...found.
Trying 'D:\Users\user\projects\.npmrc'...not found.
Trying 'D:\Users\user\projects\angular\.npmrc'...found.
The installed local Angular CLI version is older than the latest stable version.
Installing a temporary version to perform the update.
Installing packages for tooling via npm.
Installed packages for tooling via npm.
Using package manager: 'npm'
Collecting installed dependencies...
Found 57 dependencies.
[SNIP]
Not sure if this is a diff issue, but we have our npm config entries set up in memory rather than in our npmrc files, and the correct values are used when we do a npm config list
, however ng update seems to completely ignore those and instead use the ones in npmrc (which is the default, empty npmrc, doesn't have the correct values). This issue has been open a long time, is there going to be any fix for this?
We're having the same problem with yarn. The local .yarnrc.yml file is completely ignored
I think I'm having a similar problem while updating from angular 11 to angular 12 :
npm config get registry
returns the path to our artifactory registry
However, when I try ng update @angular/cli
I get this:
npm ERR! code E403
npm ERR! 403 403 DefaultErrorTemplate - GET https://registry.npmjs.org/@angular%2fcli
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.
Which is expected since the global registry access is blocked by the company proxy.
The command is not supposed to poke anything but the provided registry.
May I add that trying by hand calling https://mycompanyregistry/@angular%2fcli does work.
Thanks for reporting this issue. Luckily, it has already been fixed in one of the recent releases. Please update to the most recent version to resolve the problem.
If the problem persists in your application after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior. You can use ng new repro-app
to create a new project where you reproduce the problem.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
Ng command
Description
ng
add
andupdate
ignore npm global config🔬 Minimal Reproduction
Define a private registry (it's also an proxy for publics packages)
Set authentication
Install angular/cli
And start a new project
Ok project created and all dependencies installed (private registry checked in package-lock.json)
The problem starts here I want to transform my project to pwa see
response :
The add command requires to be run in an Angular project, but a project definition could not be found.
Ok change directory
response :
Unable to fetch package metadata: request to https://registry.npmjs.org/@angular%2fpwa failed, reason: connect ETIMEDOUT 104.16.26.35:443.
(I'am also behind a enterprise proxy)same result with
update
command, ng command want to access directly to registry.npmjs.org and not by private registry🌍 Your Environment
Npm version -> 6.9.2