I need to use SSR for one of my existing angular project. For that, I have migrated one of my projects from v8 to v13.0.0, which itself took a lot of time.
HOwever, now that the app is running fine on v13.0.0, I tried adding SSR to it using
ng add @nguniversal/express-engine
This commands seems to add 13.0.1 of universal, but it keeps failing with errors similar to below one:
D:\my-app-universal>ng add @nguniversal/express-engine i Using package manager: npm √ Found compatible package version: @nguniversal/express-engine@13.0.1. √ Package information loaded.
The package @nguniversal/express-engine@13.0.1 will be installed and executed. Would you like to proceed? Yes npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: my-app-universal@0.0.0 npm ERR! Found: @angular/animations@13.0.3 npm ERR! node_modules/@angular/animations npm ERR! @angular/animations@"~13.0.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @angular/animations@"13.2.3" from @angular/platform-server@13.2.3 npm ERR! node_modules/@angular/platform-server npm ERR! peer @angular/platform-server@"^13.0.1" from @nguniversal/express-engine@13.0.1 npm ERR!
node_modules/@nguniversal/express-engine npm ERR!
@nguniversal/express-engine@"13.0.1" 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! See C:\Users\saurabhtiwari\AppData\Local\npm-cache\eresolve-report.txt for a full report.npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\saurabhtiwari\AppData\Local\npm-cache_logs\2022-02-20T12_03_46_821Z-debug.log × Package install failed, see above.
I have tried a lot to read through the errors and updating package.json to match the required version of peers but it just doesn't go away.
Is there a systematic way to resolve these errors. Is there a particular version of universal that might go well with Angular 13.
Any suggestions are welcomed.