Skip to content

ng update @angular/core@14 got Package '@angular/core' is not a dependency. #23368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chengB12 opened this issue Jun 14, 2022 · 2 comments
Closed

Comments

@chengB12
Copy link

chengB12 commented Jun 14, 2022

🐞 Bug report

Command (mark with an x)

  • [ X] update

Is this a regression?

Yes, I used ng update to upgrade angular from v12 to v13, and there is no issue

Description

when I use yarn ng update @angular/core@14 @angular/cli@14 --force --verbose
I got

Locating potential npmrc files:
Using package manager: npm
Collecting installed dependencies...
Found 0 dependencies.
Package '@angular/core' is not a dependency.
error Command failed with exit code 1.

🔬 Minimal Reproduction

I use yarn v1.22.7 instead of npm
yet log show ng update picked npm:
Using package manager: npm

I also use child packages, instead of root, while all 3rd packages installed on root

root/package.json

{
"dependencies": {
"@angular/core": "^13.0.1",
...
},
"workspaces": [
"packages/*"
]
}

root/packages/angular-app/package.json
root/packages/angular-app/angular.json

🔥 Exception or Error





🌍 Your Environment





     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 14.0.1
Node: 16.13.0
Package Manager: npm 8.1.0
OS: win32 x64

Angular: undefined
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1300.2
@angular-devkit/core         14.0.1
@angular-devkit/schematics   14.0.1
@schematics/angular          14.0.1

Anything else relevant?

@alan-agius4
Copy link
Collaborator

The CLI is likely picking npm as a package manager because either you have a package-lock.json or/and lack of yarn-lock file.

You can configure which package manager the CLI uses the using the below command:

ng config cli.packageManager yarn

Yarn workspaces are not fully supported, please see: #14841

@alan-agius4 alan-agius4 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2022
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants