create-react-app failing on Windows 10 / node v16.14.2 / npm v8.6 #12277
-
Hi, I'm currently getting a dependency resolution problem while running Environment setup:
Does anybody know if CRA working for React 18 as of now? This is the output I'm getting: CMD >npx create-react-app react-tutorial
Creating a new React app in C:\Users\dev01\dev\react-app4\react-tutorial.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
added 1353 packages in 2m
171 packages are looking for funding
run `npm fund` for details
Initialized a git repository.
Installing template dependencies using npm...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: react-tutorial@0.1.0
npm ERR! Found: react@18.0.0
npm ERR! node_modules/react
npm ERR! react@"^18.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"<18.0.0" from @testing-library/react@12.1.5
npm ERR! node_modules/@testing-library/react
npm ERR! @testing-library/react@"^12.0.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 C:\Users\dev01\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\dev01\AppData\Local\npm-cache\_logs\2022-04-11T22_56_06_421Z-debug-0.log
`npm install --no-audit --save @testing-library/jest-dom@^5.14.1 @testing-library/react@^12.0.0 @testing-library/user-event@^13.2.1 web-vitals@^2.1.0` failed Full log:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I'm on Win11 and seeing the same. From the error dump, I believe it is the web-vitals package. I removed all traces of it from index.js (import and the function call at the bottom of the file) and am good to go with npm start leading the to the launch of the live webpage: src/index/js line 5: remove the "import reportWebVitals from './reportWebVitals';" line Btw, reportWebVitals is for performance reporting, used here during development. |
Beta Was this translation helpful? Give feedback.
-
FYI: issue solved with v5.0.1 release. |
Beta Was this translation helpful? Give feedback.
#12278
I'm on Win11 and seeing the same. From the error dump, I believe it is the web-vitals package. I removed all traces of it from index.js (import and the function call at the bottom of the file) and am good to go with npm start leading the to the launch of the live webpage:
src/index/js line 5: remove the "import reportWebVitals from './reportWebVitals';" line
src/index.js line 17: remove the "reportWebVitals();" line
Btw, reportWebVitals is for performance reporting, used here during development.
https://create-react-app.dev/docs/measuring-performance/