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

`ng update` breaks on "private" packages

Open SanderElias opened this issue 1 year ago • 5 comments

Command

update

Description

I'm unsure if this is a regression. But when there is a "private" package in an angular project, ng update fails to run.

Minimal Reproduction

To reproduce:

# use an "old" version to get started
npx @angular/[email protected] new DemoPackageIssue
cd DemoPackageIssue
# add a package from the deno std library (not really private..)
npx jsr add @std/toml
# try to upgrade:
npx ng update

Or manually add the package to the package.json like this:

  "dependencies": {
    "@angular/animations": "^18.1.0",
    ...
    "@std/toml": "npm:@jsr/std__toml@^1.0.1",
  },

Exception or Error

Using package manager: npm
Collecting installed dependencies...
Found 28 dependencies.
✖ Migration failed: 404 Not Found - GET https://registry.npmjs.org/@std%2ftoml - Not found
  See "/tmp/ng-f4tUqx/angular-errors.log" for further details.

Image

Your Environment

I didn't test it with anything older as 18.0, but I suspect _all_ versions have this issue. 
At least 19-rc.1 still has the problem

Anything else relevant?

This is an unneeded restriction. When there are packages in the package.json that Angular can't 'trace' it should be safe to ignore them. Erroring out is highly inconvenient.

SanderElias avatar Nov 11 '24 06:11 SanderElias

This issue can be reproduced in this repository: https://github.com/antonioconselheiro/bug-ng-update-with-jsr-dependencies Not only private packages, but any package from jsr throw error.

antonioconselheiro avatar Nov 14 '24 11:11 antonioconselheiro

I've opened a PR that will gracefully skip packages if it can't pull the metadata from the registry. This doesn't help it find the registry (would be useful in the case of JSR), but at least lets you continue and you can manually upgrade those dependencies later.

allout58 avatar Jan 15 '25 21:01 allout58

The issue also affects us. Trying to upgrade from v19 to v20, the migration fails with a 404 not found, because it tries to locate our local package in the npmjs registry. Not sure what use case there is for this, but a way to skip this check would be nice.

We're using the turborepo way to link local packges.

Migration failed: 404 Not Found - GET https://registry.npmjs.org/@repo%2ftypescript-config - Not found

eluchsinger avatar Jun 21 '25 12:06 eluchsinger

This is also affecting us. We use something along the lines of this in our .npmrc:

registry=https://{ouraccountid}.d.codeartifact.us-east-1.amazonaws.com/npm/npm-registry/
//{ouraccountid}.codeartifact.us-east-1.amazonaws.com/npm/npm-registry/:_authToken=${codeartifacttoken}

tsteuwer-accesso avatar Aug 25 '25 13:08 tsteuwer-accesso

affected as well.

mumenthalers avatar Sep 16 '25 13:09 mumenthalers