nebular icon indicating copy to clipboard operation
nebular copied to clipboard

ng add fails on new Angular 14 project

Open DavidTheProgrammer opened this issue 2 years ago • 10 comments

Issue type

I'm submitting a ... (check one with "x")

  • [ x ] bug report
  • [ ] feature request

Issue description

Current behavior:

ng add @nebular/theme fails on a brand new Angular 14 project.

Expected behavior:

ng add @nebular/theme completes and sets up nebular correctly.

Steps to reproduce:

1 Update @angular/cli to latest version (currently 14.0.1) and create new project. 2 Run ng add @nebular/theme.

Other information:

Angular, Nebular

  • Angular - 14.0.1
  • Nebular - 9.0.3

DavidTheProgrammer avatar Jun 15 '22 06:06 DavidTheProgrammer

First, install the package with npm with the --legacy-peer-deps flag and then execute ng add

npm install @nebular/theme --legacy-peer-deps && ng add @nebular/theme

crrlos avatar Jun 16 '22 19:06 crrlos

Hello @crrlos, thanks for the response. I tried running the last command on a brand new Angular project and got a pretty similar outcome. See an excerpt from the logs below:

npm ERR! ERESOLVE unable to resolve dependency tree 
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/animations
npm ERR!   @angular/animations@"^14.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/animations@"^13.0.0" from @nebular/[email protected]
npm ERR! node_modules/@nebular/theme
npm ERR!   @nebular/theme@"^9.0.3" from the root project
npm ERR!   peer @nebular/theme@"9.0.3" from @nebular/[email protected]
npm ERR!   node_modules/@nebular/eva-icons
npm ERR!     @nebular/eva-icons@"9.0.3" 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.

DavidTheProgrammer avatar Jun 16 '22 21:06 DavidTheProgrammer

Same issue here, is there any fix now?

Shomy032 avatar Sep 10 '22 13:09 Shomy032

Same issue. Somebody?

jasmap avatar Sep 11 '22 13:09 jasmap

Hi all,

Am I right in saying nebular uses old version of certain packages that are not angular 14 i.e in the above it's using anugular animations 13 and because we have animations in the root of our own project's package.json file and here it's 14. So then it does not install nebular in @node_module at all and the solution is for the actual nebular package we use to install via npm or ng add to be removed or some how changed to be compatible with the nebular package version of the item?

codered13 avatar Sep 21 '22 12:09 codered13

Same issue. No resolution on this yet?

ciomofoiur avatar Sep 21 '22 16:09 ciomofoiur

I don't understand why no one realises the problem is nebular package needs other packages as part oof its install and they clash with the packages the user has already installed and that nebular uses older versions of them. It's not a simple angular 14 update. Nebular the package uses older other packages and the nebular package itself has to be updated to use the latest of all the packages it needs. I gave a example before of this but no one obviously reads the comments. Look at my previous comment. Once again an example of this is:

@angular/animations version 13 as stated here: @angular/animations@"^13.0.0" from @nebular/[email protected], regarding this I have angular animation 14 but nebular uses 13. @angular/animations.

BTW this issue is the same problem as this one: but once again no one reads: https://github.com/akveo/nebular/issues/3078

codered13 avatar Sep 29 '22 00:09 codered13

So what is the solution codered13?

donev-stan avatar Oct 05 '22 13:10 donev-stan

In this I have downgrade the @angular/[email protected] to @angular/[email protected] after that I have created the new angular project and add nebular/theme by following below code ng add @nebular/theme and It works for me

VipulSha99 avatar Oct 18 '22 05:10 VipulSha99

@VipulSha99 but just downgrading isn't really a solution. Nebular simply not updating to the newest Version of the tool it's made for will cost them their userbase.

Darquaise avatar Jun 01 '23 11:06 Darquaise