Angular version update giving an error - Migration failed: Could not find any tsconfig file
Asked Answered
L

5

8

I am trying to update an Angular project (in version 8) to version 9. when running the ng update it gives an error saying

Migration failed: Could not find any tsconfig file. Cannot migrate dynamic queries.

after some time. but when check the version it shows as 9. but many required changes are not there.

any solution or workaround is appreciated.

Lucylud answered 29/6, 2021 at 10:39 Comment(2)
Hi @i_sapumal. Did you find the solution for this? I'm stuck with the exact same error. Thanks!Hale
I'm stuck on a similair issue trying to upgrade from Angular 11 to 12. Migration failed: Could not find any tsconfig file. Cannot migrate `ActivatedRouteSnapshot.fragment` accesses. Same question did you find a solution?Thorn
E
4

In order to run the migrations you need to install the @angular-devkit/core package

npm i @angular-devkit/core@<VERSION> -D
ng update --from <FROM_VERSION> --to <VERSION> --migrate-only --allow-dirty --verbose @angular/core

After migrations you could remove the package again.

Ephemerality answered 24/8, 2022 at 9:57 Comment(0)
R
1

I got the same error upgrading from angular 8 to 9. I had a tsconfig file in my project and it was linked well. In my case the error was caused by the @angular-devkit/schematics package. I resolved the error by the following steps:

  1. remove the package @angular-devkit/schematics from your package.json
  2. delete the node_modules and package-lock.json
  3. npm i (I need to execute npm i --legacy-peer-deps - but be careful with that)
  4. npx @angular/cli@9 update @angular/core@9 @angular/cli@9

Let me now if this worked. Hope this might help someone

Renin answered 22/12, 2021 at 16:0 Comment(1)
This worked, although for step 1 you can do: npm uninstall @angular-devkit/schematics and skip therefor step 3. Thanks for your helpAdvisee
B
0

It says cannot migrate to dynamic queries please try the below code

npx @angular/cli@9 update @angular/core@9 @angular/cli@9 --force
Belita answered 30/11, 2021 at 11:10 Comment(1)
I tried this solution above and it does not work. This just forces Angular to use packages with un resolved dependencies. It did not correct this issue for me.Thorn
N
0

When I was hit with this error. All I had to do was, run; 'ng update'. I was given the suggestion what to do next. Attached for reference below;

In my case I had to run as suggested; 'ng update @angular/core@12'

✖ Migration failed: Could not find any tsconfig file. Cannot migrate AbstractControl.parent accesses.
  See "/private/var/folders/s/C/K/angular-errors.log" for further details.

    app_code % ng update
    Using package manager: 'npm'
    Collecting installed dependencies...
    Found 29 dependencies.
        We analyzed your package.json, there are some packages to update:
        
          Name                               Version                  Command to update
         --------------------------------------------------------------------------------
          @angular/core                      11.2.14 -> 12.2.9        **ng update @angular/core@12**
Nevanevada answered 4/2, 2022 at 6:13 Comment(0)
G
0

For me the issue was my version of node. v12.22.12 worked for me.

Gest answered 14/12, 2022 at 22:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.