sajivkumar / mathjax-angular

Mathjax 3 for angular
10 stars 13 forks source link

Outdated dependencies #26

Closed chrlembeck closed 7 months ago

chrlembeck commented 1 year ago

I have an angular 15.1.0 project and tried to integrate mathjx-angular using the command npm install mathjax-angular. Unfortunately this was answered by the following response:

λ npm install mathjax-angular
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: mathhelper@0.0.0
npm ERR! Found: @angular/common@15.1.4
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"^15.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^14.0.0" from mathjax-angular@2.1.1
npm ERR! node_modules/mathjax-angular
npm ERR!   mathjax-angular@"*" 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.

Is it save to force the installation or will there be an angulat 15 compatible version of this project?

mautematico commented 1 year ago

--force worked just fine for me! :)

EDIT: be sure to import mathjax forRoot on the app component AND importing mathjax forChild() on the childs :)

mratanusarkar commented 1 year ago

I hope this library is still getting actively built, and the devs update the dependencies for long-term stability and fix.

roy-ganz commented 10 months ago

As a workaround you can override the dependencies. See stackoverflow.

For mathjax-angular put this in your package.json:

"overrides": {
    "mathjax-angular": {
      "@angular/common": "$@angular/common",
      "@angular/core": "$@angular/core"
    }
  },
sajivkumar commented 7 months ago

https://github.com/sajivkumar/mathjax-angular/pull/30