[MGNLFE-148] Can not install 1.1.2 angular-editor with project created Angular 12 Created: 16/Nov/21  Updated: 22/Jul/22  Resolved: 24/Nov/21

Status: Closed
Project: Magnolia Frontend Helpers
Component/s: None
Affects Version/s: 1.1.2
Fix Version/s: 1.2.0

Type: Bug Priority: Critical
Reporter: Bartosz Staryga Assignee: Canh Nguyen
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 1d 2.5h
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLFE-137 1.1.0 not working with latest Angular Closed
relates to MGNLFE-149 6.2.13, Angular 12, 1.1.2 angular-edi... Closed
duplicate
duplicates MGNLFE-151 peerDependencies Angular 11+ Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Release notes required:
Yes
Date of First Response:
Epic Link: SaaS TPR - SPA Tests
Team: DeveloperX

 Description   

Steps to reproduce

  1.  ng new magnolia-spa
  2.  cd magnolia-spa
  3. npm install @magnolia/angular-editor

Expected results

Install of the package is successful

Actual results

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: magnolia-spa@0.0.0
npm ERR! Found: @angular/common@12.2.13
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"~12.2.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^10.2.4" from @magnolia/angular-editor@1.1.2
npm ERR! node_modules/@magnolia/angular-editor
npm ERR!   @magnolia/angular-editor@"*" 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 /Users/bartoszstaryga/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/bartoszstaryga/.npm/_logs/2021-11-16T15_29_40_005Z-debug.log


 Comments   
Comment by Christopher Zimmermann [ 17/Nov/21 ]

Work around can be to use angular-editor 1.0.6, right bstaryga ?

Comment by Christopher Zimmermann [ 17/Nov/21 ]

I just updated my angular CLI to the latest version - 

Angular CLI: 13.0.2

And then followed the above steps and the install of angular-editor succeeded.

But I did get a number of warnings:

mag-v112$ npm install @magnolia/angular-editor
npm WARN ajv-keywords@3.5.2 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN @magnolia/angular-editor@1.1.2 requires a peer of @angular/common@^10.2.4 but none is installed. You must install peer dependencies yourself.
npm WARN @magnolia/angular-editor@1.1.2 requires a peer of @angular/core@^10.2.4 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-android-arm64@0.13.12 (node_modules/esbuild-android-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-android-arm64@0.13.12: wanted {"os":"android","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})

...and many more SKIPPING OPTIONAL DEPENDENCY 

And now I tried with Angular CLI 12.2.12 and get the same results, the install succeeds with warnings.

Im on MacOS

Node 14.17.3

npm 6.14.13

Comment by Christopher Zimmermann [ 17/Nov/21 ]

When installing with 1.0.6 (npm install @magnolia/angular-editor@1.0.6)

the npm WARNS about angular 10 do not appear.

Comment by Bartosz Staryga [ 17/Nov/21 ]

czimmermann yep, you are correct yet again 1.0.6 did install without error.

Comment by Jens Neubauer (Inactive) [ 19/Nov/21 ]

The error occurs with 

@angular/common@12.2.0 (but presumably all versions <> 10.2.x)

npm 8.1.2

node 14.18.1

Comment by Canh Nguyen [ 19/Nov/21 ]

I know the issue, I will create a PR soon.

Comment by Christopher Zimmermann [ 22/Nov/21 ]

Will this also resolve https://jira.magnolia-cms.com/browse/MGNLFE-151?

Comment by Christopher Zimmermann [ 22/Nov/21 ]

OK, confirming I get the problem after updating to npm 8

Comment by Bartosz Staryga [ 29/Nov/21 ]

Confirmed, works well with 1.2.0-beta

Generated at Mon Feb 12 05:44:42 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.