7

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.

i_sapumal
  • 222
  • 2
  • 10
  • Hi @i_sapumal. Did you find the solution for this? I'm stuck with the exact same error. Thanks! – Ivan Clavijos Nov 01 '21 at 22:11
  • 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? – Showcaselfloyd Dec 14 '21 at 18:59

5 Answers5

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

  • This worked, although for step 1 you can do: npm uninstall @angular-devkit/schematics and skip therefor step 3. Thanks for your help – anexo Jun 27 '22 at 13:38
1

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.

krema
  • 939
  • 7
  • 20
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
  • 2
    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. – Showcaselfloyd Dec 14 '21 at 19:00
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**
Ricky Boy
  • 723
  • 7
  • 7
0

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

kyleo347
  • 11
  • 1