angular/universal

ng add @nguniversal/express-engine fails to install

Eidar opened this issue ยท 7 comments

Eidar commented

๐Ÿž Bug report

I cannot install Angular Universal with Angular Material. Running a fresh installation, adding Angular Material and then Angular Universal results in a dependency error.

  • builders
  • common
  • [ x] express-engine

Is this a regression?

I have been able to successfully install both Angular Material and Angular Universal using version 12. It worked but it was broken a bit, but I did not invest time and effort to fix it. I had hoped that this was resolved.

Description

Cannot ng add Angular Universal because of the version mismatch. It seeks 15 or greater, I have 15.01. and it's apparently not something that Universal can work with.

๐Ÿ”ฌ Minimal Reproduction

Initialize new Angular project and add Angular Material. Try and run ng add @nguniversal/express-engine.

๐Ÿ”ฅ Exception or Error


ฮป ng add @nguniversal/express-engine
i Using package manager: npm
โˆš Found compatible package version: @nguniversal/express-engine@15.1.0.
โˆš Package information loaded.

The package @nguniversal/express-engine@15.1.0 will be installed and executed.
Would you like to proceed? Yes
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: kcp-frontend@0.0.0
npm ERR! Found: @angular/animations@15.1.2
npm ERR! node_modules/@angular/animations
npm ERR!   peer @angular/animations@"^15.0.0 || ^16.0.0" from @angular/material@15.1.2
npm ERR!   node_modules/@angular/material
npm ERR!     @angular/material@"^15.1.2" from the root project
npm ERR!   peerOptional @angular/animations@"15.1.2" from @angular/platform-browser@15.1.2
npm ERR!   node_modules/@angular/platform-browser
npm ERR!     peer @angular/platform-browser@"15.1.2" from @angular/forms@15.1.2
npm ERR!     node_modules/@angular/forms
npm ERR!       peer @angular/forms@"^15.0.0 || ^16.0.0" from @angular/material@15.1.2
npm ERR!       node_modules/@angular/material
npm ERR!         @angular/material@"^15.1.2" from the root project
npm ERR!       1 more (the root project)
npm ERR!     peer @angular/platform-browser@"^15.0.0 || ^16.0.0" from @angular/material@15.1.2
npm ERR!     node_modules/@angular/material
npm ERR!       @angular/material@"^15.1.2" from the root project
npm ERR!     3 more (@angular/platform-browser-dynamic, @angular/router, the root project)
npm ERR!   1 more (the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! @nguniversal/express-engine@"15.1.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/animations@15.1.4
npm ERR! node_modules/@angular/animations
npm ERR!   peer @angular/animations@"15.1.4" from @angular/platform-server@15.1.4
npm ERR!   node_modules/@angular/platform-server
npm ERR!     peer @angular/platform-server@"^15.0.0" from @nguniversal/express-engine@15.1.0
npm ERR!     node_modules/@nguniversal/express-engine
npm ERR!       @nguniversal/express-engine@"15.1.0" 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\Matija\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\Matija\AppData\Local\npm-cache\_logs\2023-02-12T12_10_17_463Z-debug.log
ร— Packages installation failed, see above.

๐ŸŒ Your Environment



1. [Angular CLI](https://github.com/angular/angular-cli) version 15.1.4.
2. node 16.13.1
3. npm 8.1.2
4. nvm 1.1.9.
5. Angular Material 15.1.2

Hi @Eidar,

Can you try to update the Angular packages to the latest patch version?

Hey @Eidar, have you solved it?, I am presenting the same error... :(

use this command "npm install @nguniversal/express-engine --legacy-peer-deps"

Eidar commented

Hi @Eidar,

Can you try to update the Angular packages to the latest patch version?

This is a newly created project, so it's the latest version. Node is a bit older cause Ghost CMS doesn't work with higher versions.

Hey @Eidar, have you solved it?, I am presenting the same error... :(

Unfortunately I quit on that project and made a new one using new version of node and everything works perfectly

use this command "npm install @nguniversal/express-engine --legacy-peer-deps"

I tried, and it was kind of broken.

Hi @Eidar

  1. remove the package node-modules
  2. remove the file package-lock.json
  3. run the command "npm install"
  4. run this command "npm install @nguniversal/express-engine --legacy-peer-deps"
    If the package "@nguniversal/express-engine" will be installed, without creating files "server.ts" and "app.server.module.ts", then
  5. run the command "ng add @nguniversal/express-engine"

Hi @Eidar,
Can you try to update the Angular packages to the latest patch version?

This is a newly created project, so it's the latest version. Node is a bit older cause Ghost CMS doesn't work with higher versions.

Hey @Eidar, have you solved it?, I am presenting the same error... :(

Unfortunately I quit on that project and made a new one using new version of node and everything works perfectly

use this command "npm install @nguniversal/express-engine --legacy-peer-deps"

I tried, and it was kind of broken.

Hi @Eidar, Which version of node are you using on your new project?, I'm using node 18.13.0 and angular 15.1.3 but still not working

image

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.