Installing template dependencies using npm...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: learn@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\user\AppData\Local\npm-cache\eresolve-report.txt for a full report.
Quand je l'ai utilisé npm start
, il donne cette erreur:
Compiled with problems:
ERROR in./src/reportWebVitals.js 5:4-24
Module not found: Error: Can't resolve 'web-vitals' in 'D:\React\Education\Fetch api\my-learn\src'
J'ai essayé avec vider le cache,
en supprimant les modules de nœud puis en les réinstallant ( npm install
),
Puis changé de package.json à ceci :
remplacez "react": "^18.0.0" & "react-dom": "^18.0.0" par une version antérieure, par exemple "react": "^17.0.2" & "react-dom": "^17.0. 2".
Enfin, lancez npm install
.
Aucune des solutions n'a fonctionné pour moi. Comment puis-je résoudre ça?
Solution du problème
Depuis
React JS npm start shows n'a pas réussi à compiler les éléments vitaux Web
Exécuter essentiellement
npm i web-vitals --save-dev
sur votre terminal et cela devrait fonctionner.
Aucun commentaire:
Enregistrer un commentaire