7.2.13 React Client npm install failed

Hi team,

Create a new CUBA project and add react frontend using Studio, npm install will fail:

npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: forumfront@0.1.0
npm ERR! Found: typescript@4.1.5
npm ERR! node_modules/typescript
npm ERR!   dev typescript@"~4.1.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional typescript@"^4.2" from react-intl@5.14.0
npm ERR! node_modules/react-intl
npm ERR!   react-intl@"^5.3.0" from the root project
npm ERR!   peer react-intl@"^5.3.0" from @cuba-platform/react-ui@2.0.0
npm ERR!   node_modules/@cuba-platform/react-ui
npm ERR!     @cuba-platform/react-ui@"^2.0.0-beta.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 /Users/bryan/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/bryan/.npm/_logs/2021-03-26T09_24_15_006Z-debug.log

platform version:
CUBA Platform version: 7.2.13
CUBA Studio plugin version: 15.3-202
IntelliJ version: IntelliJ IDEA 2020.3.3 (Ultimate Edition)

Hi.

Unfortunately, we cannot reproduce the problem. We will be able to help you if you send us a small sample project that demonstrates the issue.

Regards,
Nadezhda.

What is the node and npm version in your env?

I have node.js v15.10.0 and npm 7.5.3

I use npm v7.6.3 and node.js v14.15.5

Thank you for your response! Reminds me that newer node or npm will do strict deps check and cause the problem.

googled and find node.js - Error when trying to install react-redux dependency - Stack Overflow

Then tried with below command resolved the issue.

npm i --legacy-peer-deps

I have upgraded now Node.js to v.15.12.0 and your issue has been reproduced.

There is a known Github issue about problem with npm install using npm 7.

Using Node.js v14.16.0 (LTS version) resolved the issue in my case.

Regards,
Nadezhda.

Yes, I also tried to downgrade node.js to 14 and see the issue is gone.

Since this is a known issue, hopefully it could be resolved some day, because the root cause is mismatched deps. But for now, we can suggest developers to install LTS version of node.js to avoid this problem.

1 Like