DEV Community

Afil Ansari
Afil Ansari

Posted on

Jodit-angular dependency issue while migrating to Angular 9

Getting the below error while trying to run the command npm install after the angular migration to version 9.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: jodit-angular@1.9.4
npm ERR! Found: zone.js@0.10.3
npm ERR! node_modules/zone.js
npm ERR!   peer zone.js@"~0.10.3" from @angular/core@9.1.13
npm ERR!   node_modules/@angular/core
npm ERR!     @angular/core@"^9.1.13" from the root project
npm ERR!     peer @angular/core@"9.1.13" from @angular/animations@9.1.13 
npm ERR!     node_modules/@angular/animations
npm ERR!       @angular/animations@"^9.1.13" from the root project       
npm ERR!       2 more (@angular/platform-browser, jodit-angular)
npm ERR!     11 more (@angular/cdk, @angular/common, @angular/forms, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer zone.js@"~0.9.1" from jodit-angular@1.9.4
npm ERR! node_modules/jodit-angular
npm ERR!   jodit-angular@"1.9.4" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: zone.js@0.9.1
npm ERR! node_modules/zone.js
npm ERR!   peer zone.js@"~0.9.1" from jodit-angular@1.9.4
npm ERR!   node_modules/jodit-angular
npm ERR!     jodit-angular@"1.9.4" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!

npm ERR! A complete log of this run can be found in:
Enter fullscreen mode Exit fullscreen mode

I have added the zone.js deps version in the package.json as an override to the jodit-angular as below.

"overrides": {
  "angular/core": {
    "zone.js": "$zone.js"
  }
}
Enter fullscreen mode Exit fullscreen mode

This just helped me to run the npm install successfully but the jodit is undefined while trying to run the application.
Console error,

Uncaught TypeError: Cannot read properties of undefined (reading 'Jodit')
Enter fullscreen mode Exit fullscreen mode

Will it help me if I upgrade the version to Angular 10

Any help would be appreciated.

Top comments (0)