-
Notifications
You must be signed in to change notification settings - Fork 12k
ng update adds a fake dependency/package #30374
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
Comments
I'm sorry, but we can't reproduce the problem following the instructions you provided. Can you setup a minimal repro please? You can read here why this is needed. A good way to make a minimal repro is to create a new app via This might be related to your directory structure so its really important to get an accurate repro to diagnose this. |
ok, no problem. Here it is: https://github.com/ChrisMBarr/angular-cli-issue-30374-reproduction You can run Here's a screenshot of the file diff after running this with the fake dependencies added: |
Hi @ChrisMBarr, thanks for the reproduction. Unfortunately, I am seeing unable to replicate this. |
You ran the script from the root level and not from each app, right? I just downloaded my repo above on my home computer (Mac OS X) and I was not able to reproduce it here either. I am not sure what might be specific about running that command on my work computer. I am running Node 22 on this Mac, but I believe only Node 20 on my work machine, not sure if that would make a difference or not. Do you have any tips on what else I could look for on my work machine to see why this only happens there? |
Back on my work computer and I was wrong, I am also using Node 22 here. Just ran the script to update from 19.2.12 to 19.2.13 and it happened again |
One thing that confuses me a bit is why npm is a patch version behind in that output:
That seems very minor but is weird. From all I can tell (including the release metadata), nodejs 22 should be shipping with npm v10.9.2, not npm v10.9.1. |
I just ran With that, I opened up my linked reproduction repo and ran my update script. It still happens. Here's what the inside of the {
"name": "app-2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "app-2",
"dependencies": {
"@angular/animations": "19.2.13",
"@angular/common": "19.2.13",
"@angular/compiler": "19.2.13",
"@angular/core": "19.2.13",
"@angular/forms": "19.2.13",
"@angular/platform-browser": "19.2.13",
"@angular/platform-browser-dynamic": "19.2.13",
"@angular/router": "19.2.13",
"app-2": "file:",
"rxjs": "*",
"tslib": "2.3.0",
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "19.2.13",
"@angular/cli": "19.2.13",
"@angular/compiler-cli": "19.2.13"
},
"peerDependencies": {
"rxjs": "*",
"typescript": "*"
} And then scrolling way down, it adds this: "node_modules/app-2": {
"resolved": "",
"link": true
}, And even more wild... there actually is a folder for this in my |
Uh oh!
There was an error while loading. Please reload this page.
Command
update
Is this a regression?
The previous version in which this bug was not present was
No response
Description
I have a monorepo with several angular apps, and I added an NPM script to run
ng update
for me. I made a script on the root monorepo level to run the script on all of the child applications. When I do this, it always seems to ADD a fake dependency to each of the apppackage.json
files which is the name of that projectMinimal Reproduction
On the root level package I have this NPM script
And here is what the individual app package files look like
From the root level I run
npm run update-angular-apps
and it modifies thepackage.json
files with all the correct updates, and then after a little bit of time it adds a fake package todependencies
as a final step. It is formatted likeand I have to manually delete this and re-run
npm install
on each child application since it does add an entry to thepackage-lock.json
file for this as wellException or Error
Your Environment
Anything else relevant?
The root package does NOT have any Angular packages installed on it, only the child apps have them. I'm not sure if this would matter or not. I mean, the upgrades do all work, it just adds some nonsense that I have to remove each time
The text was updated successfully, but these errors were encountered: