react-boilerplate / react-boilerplate-cra-template

:fire: Setup Create React App with React Boilerplate. Highly scalable & Best DX & Performance Focused & Best practices.

Home Page:https://react-boilerplate.github.io/react-boilerplate-cra-template/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conflicting react-versions while creating a new app

mricharz opened this issue · comments

Description

Creating a new app on windows with nxp throws error during setup phase because of conflicting react versions.

Steps to reproduce

Just run: npx create-react-app admin --template rb

Result:

Creating a new React app in C:\Users\***\IdeaProjects\*****\admin.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template-rb...


added 1422 packages in 5m

170 packages are looking for funding
  run `npm fund` for details        

Installing template dependencies using npm...
npm ERR! code ERESOLVE                             
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: admin@0.1.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"17.0.2" from the root project    
npm ERR! 
npm ERR! Could not resolve dependency:             
npm ERR! peer react@"^16.6.0" from redux-injectors@1.3.0
npm ERR! node_modules/redux-injectors
npm ERR!   redux-injectors@"1.3.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 eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\***\AppData\Local\npm-cache\_logs\2022-03-19T14_26_38_596Z-debug-0.log
`npm install --no-audit --save @reduxjs/toolkit@1.7.1 fontfaceobserver@2.1.0 i18next@21.6.6 i18next-browser-languagedetector@6.1.2 react@17.0.2 react-app-polyfill@3.0.0 react-dom@17.0.2 react-helmet-async@1.2.2 react-i18next@11.15.3 react-is@17.0.2 react-redux@7.2.6 react-router-dom@5.2.0 redux-injectors@1.3.0 redux-saga@1.1.3 sanitize.css@13.0.0 styled-components@5.3.3 web-vitals@2.1.2 @testing-library/jest-dom@5.16.1 @testing-library/react@12.1.2 @types/fontfaceobserver@2.1.0 @types/jest@27.4.0 @types/node@14.14.31 @types/react@17.0.38 @types/react-dom@17.0.11 @types/react-redux@7.1.22 @types/react-router-dom@5.3.2 @types/react-test-renderer@17.0.1 @types/rimraf@3.0.2 @types/shelljs@0.8.11 @types/styled-components@5.1.20 @types/testing-library__jest-dom@5.14.2 @types/webpack@5.28.0 @types/webpack-env@1.16.3 chalk@4.1.2 cross-env@7.0.3 eslint-config-prettier@8.3.0 eslint-plugin-prettier@4.0.0 eslint-plugin-react-hooks@4.3.0 husky@7.0.4 i18next-scanner@3.1.0 inquirer@7.3.3 inquirer-directory@2.2.0 jest-styled-components@7.0.8 lint-staged@12.1.7 node-plop@0.26.2 plop@2.7.4 prettier@2.5.1 react-test-renderer@17.0.2 rimraf@3.0.2 serve@13.0.2 shelljs@0.8.5 stylelint@14.2.0 stylelint-config-recommended@6.0.0 stylelint-config-styled-components@0.1.1 stylelint-processor-styled-components@1.10.0 ts-node@10.4.0 typescript@4.5.4` failed

eresolve-report.txt
2022-03-19T14_26_38_596Z-debug-0.log

TL:DR: redux-injectors is still using react 16 and is therefore conflicting with react 17
Doesn't matter if yarn is using its "on error resume next"-functionality. Following semver: a major release is a breaking change to the prev. version and therefore this error is valid and should be resolved.

Expected behavior
Creating the app without error during setup.

Versions

  • react-boilerplate-cra-template: 1.2.3
  • Node/NPM: v16.14.0 / 8.5.4
  • OS: Win 10 21H2 BuildNo. 19044.1586

This is not the same package. This is the command to create

yarn create react-app --template cra-template-rb my-app