Skip to content

ng update: "Package '@angular/core' is not a dependency" in a bun workspace member #34402

Open

Description

@euskadi31

Command

update

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

20.3.40

Description

In a bun workspace where the Angular project is a workspace member (not the root package), ng update <package> cannot find any of the project's dependencies:

$ bunx ng update @angular/core
Using package manager: bun
Collecting installed dependencies...
Found 1 dependencies.
Package '@angular/core' is not a dependency.

The same layout behaves differently by CLI version (checked today with bun 1.4.3):

  • 20.3.40: Found 20 dependencies, then Package '@angular/core' is already up to date.
  • 21.2.27: Found 1 dependencies. then Package '@angular/core' is not a dependency. (ng update without arguments still lists the packages)
  • 22.2.3: same failure. This also blocks ng update @angular/core@22 @angular/cli@22 from 21, since the temporary 22 CLI fails the same way.

#32787 fixed this for npm workspaces (#34308). The bun path has no equivalent, and on main it is unchanged:

  • listDependenciesCommand for bun is ['pm', 'ls']. Run from the member's directory, it prints the root's dependencies, that is the workspace members themselves:

    /tmp/repro node_modules (405 installed)
    └── app@workspace:app
    
  • parseBunDependencies(stdout, logger) does not use the { workspacePackageName } options that #populateDependencyCache passes. It returns that single entry, so every requested package is "not a dependency".

#32781 reported this for bun (same layout) and was closed as a duplicate of #32787, but the npm fix does not cover it.

Since bun pm ls has no per-member output, one possible direction is to build the member's dependency map from its package.json and the installed manifests. The migrateOnly path already falls back to that through findPackageJson.

Minimal Reproduction

mkdir repro && cd repro
printf '{ "name": "root", "private": true, "workspaces": ["app"] }\n' > package.json
bunx @angular/cli@22.2.3 new app --skip-git --skip-install --package-manager bun --defaults --interactive=false --ssr=false --ai-config=none
bun install
cd app
bunx ng update @angular/core

Exception or Error

Using package manager: bun
Collecting installed dependencies...
Found 1 dependencies.
Package '@angular/core' is not a dependency.

Your Environment

Angular CLI       : 22.2.3
Node.js           : 24.21.0
Package Manager   : bun 1.4.3
Operating System  : darwin arm64

Anything else relevant?

Workaround: update the versions with bun (bun add @angular/core@^22.2.3 …), then run each package's migrations with ng update <package> --migrate-only --from=<old> --to=<new>. That path does not depend on the dependency list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions