DEV Community

Sunanda
Sunanda

Posted on

Unable to upgrade from angular version 14 to 17

Hi,

We are trying to upgrade form angular version from 14 to 17 following the steps in the below url.
https://update.angular.io/?v=14.0-17.0

It gave error related to schematic dependency so used the below line to upgrade to 15 and 16.
ng update @angular/core@16 @angular/cli@16 @angular-eslint/schematics@16
ng update @angular/core@16 @angular/cli@16 @angular-eslint/schematics@16

after upgrading to 15, when build the code it worked. Later after upgrading to 16 when build the code it failed.

When ran ng version command, noticed @angular.cdk and @angular/material version are still shown as 14 and are not upgraded.
So upgraded these 2 to version 15 and 16 using the below commands
ng update @angular/material@15 @angular/cdk@15
ng update @angular/material@16 @angular/cdk@16

Built the code got the below error. Any idea how this can be fixed.
node_modules/ng2-dragula/dist/components/dragula.module.d.ts:3:23 - error TS2314: Generic type 'ModuleWithProviders' requires 1 type argument
Please note tried multiple times by removing the node_modules and rolling back package.json and re-ran upgrade, but encountering the same issue.
Any idea what is the problem here.

Thanks,
Sunanda.

Top comments (2)

Collapse
 
hakimio profile image
Tomas Rimkus

Most likely you are mixing Angular versions. Delete node_modules, package.lock, make sure you only have the latest versions in your package.json and install again.

Collapse
 
sunanda profile image
Sunanda

Tried doing that and also "npm clean-install". Still the same error.