angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng update takes from registry.npmjs.com rather than github

Open SamuelMarks opened this issue 6 years ago • 9 comments

Versions

Angular CLI: 6.0.0
Node: 8.11.1
OS: darwin x64
Angular: 6.0.0

Repro steps

  • Add a github package to your package.json, team/repo-name should work, or with tarball: https://api.github.com/repos/team/repo-name/tarball.
  • Run ng update

Observed behavior

$ ng update @angular/cli
Registry returned 404 for GET on https://registry.npmjs.org/repo-name

Desired behavior

It shouldn't look to registry.npmjs when a github version is referred.

Mention any other details that might be useful (optional)

SamuelMarks avatar May 04 '18 15:05 SamuelMarks

from #10614 , to temporarily get past this @james-tonicanalytics

The temporary solution that stopped the error occurring was to delete the local dependency from the package.json file and then run ng update @angular/cli. Once the .angular-cli.json was migrated to angular.json, I added the local dependency back in.

scottleedavis avatar May 05 '18 19:05 scottleedavis

Not sure if this helps, I'm using a private npm registry and uses npm login --registry=url. Angular CLI should read from ~/.npmrc instead?

beeing avatar Jun 25 '18 08:06 beeing

Commenting out the dependency in package.json resolves it but it would be great even a simple and lazy solution as preventing the update from stopping. Please Google fix this :)

xcash avatar Nov 15 '18 09:11 xcash

Any news about this issue? We tried migrating to Angular 7, but ng update failed with 404 due to calls to the wrong registry...

JayceeZ avatar Dec 04 '18 10:12 JayceeZ

I am also having an issue with this. I have a private registry set in my global npmrc (and yarnrc) and the cli seems to be playing by it's own rules rather than respecting the global config. I also tried setting a local npmrc file and had the same issue. 404 Not Found - GET https://registry.npmjs.org/mypackage- Not found

Steven-Harris avatar Dec 27 '18 18:12 Steven-Harris

Any update on this issue? When will it be possible to configure the npm registry used by ng update/ng cli? Please kindly reply...

balteo avatar May 29 '20 13:05 balteo

The Angular CLI will honor the configuration found in .npmrc files. If you are encountering issues in this regard please open a separate issue detailing the problem. This issue pertains to the use of non-registry sourced dependencies (file, git, directory, etc.). Analyzing such dependencies is not currently supported via ng update but as of 9.1 they will no longer cause an error.

clydin avatar May 29 '20 16:05 clydin

@clydin Thanks for the reply and sorry for the misunderstanding. I will open a separate issue.

balteo avatar May 29 '20 16:05 balteo

This issue should not just be from github but for private repo manager URL. The ng update command should be smart enough to see that there is an .npmrc file and then update based on that. Fall back should be the npm registry if it can't find a repo.

andrewpolemeni avatar Jul 11 '22 19:07 andrewpolemeni

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.

alan-agius4 avatar Nov 14 '22 10:11 alan-agius4

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.