[MGNLFE-84] peerDependencies in npm 7 prevent installing of react-editor Created: 18/Nov/20  Updated: 21/Jan/21  Resolved: 12/Jan/21

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

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

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: SPA Editor
Sprint: HL & LD 18, HL & LD 19, HL & LD 20
Story Points: 2

 Description   

Steps to reproduce

Make sure you run npm in version 7.
Run: npm install @magnolia/react-editor

Expected results

@magnolia/react-editor installed correctly.

Actual results

Error:
$ npm install @magnolia/react-editor
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: react-magnolia@0.1.0
npm ERR! Found: react@16.14.0
npm ERR! node_modules/react
npm ERR! react@"^16.13.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"16.12.0" from @magnolia/react-editor@1.0.5
npm ERR! node_modules/@magnolia/react-editor
npm ERR! @magnolia/react-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/2020-11-18T12_46_15_369Z-debug.log

Workaround

npm install @magnolia/react-editor --legacy-peer-deps

Development notes

Only react-editor has those dependencies, angular one lacks it.
In our libs there is no need to include those dependencies.

Info about changes in new npm:
https://github.blog/2020-10-13-presenting-v7-0-0-of-the-npm-cli/

Node and npm versions:https://nodejs.org/en/download/releases/

Npm 7 is shipped with Node 15, the actual current version of node.



 Comments   
Comment by Robert Šiška [ 04/Jan/21 ]

Can you elaborate on Steps to reproduce? I can't reproduce the error.

Angular-editor does contain peer dependencies as well, and it fails on the same error.
See: https://git.magnolia-cms.com/users/rsiska/repos/frontend-helpers/browse/packages/angular-editor/projects/angular-editor/package.json

$ npm install @angular/cli
$ ng new my-app
$ cd my-app
$ npm install @magnolia/angular-editor
Comment by Christopher Zimmermann [ 05/Jan/21 ]

rsiska Do you think  we should create a new ticket for that error? Sounds like its the same bad experience as with React?

Comment by Robert Šiška [ 11/Jan/21 ]

No, we have solution for both - I was just elaborating on the Acceptance Criteria.

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