create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Can't resolve 'web-vitals' in react-Project/src

Open oussamaennadafy opened this issue 2 years ago • 10 comments

i just get started with react and as soon as i create new react app using create-react-app tool it gives an error without any modification of the project code

oussamaennadafy avatar Mar 07 '23 08:03 oussamaennadafy

This error happened to me for the first time today. This is new... And as I am new to react (I just started using it a couple of month ago) I don't know how to fix it...

laladiaz avatar Mar 17 '23 16:03 laladiaz

yes laladiaz, actually the whole create-react-app tool is no longer supported even by react team itself, as you might see in the new documentation version on react https://react.dev, instead, it encourages us to use create-next-app or vite, personally, I like how simple vite is.

oussamaennadafy avatar Mar 17 '23 20:03 oussamaennadafy

Thank you Oussama!!! I just saw the new documentation came out yesterday and I haven't check it out yet! I really appreciate the info... also, I will check vite out!! 🌟

laladiaz avatar Mar 17 '23 21:03 laladiaz

You need to install web vitals. Open your terminal and run the following command:

npm i web-vitals --save-dev

harley-dane avatar Dec 26 '24 11:12 harley-dane

thanks harley-dane,It worked for me

EhsanJan avatar Dec 26 '24 13:12 EhsanJan

@harley-dane thank you!

Vinayakmapari avatar Dec 27 '24 09:12 Vinayakmapari

Thank you so much Harley!

LajosPosta avatar Jan 23 '25 09:01 LajosPosta

Thank You Harley, it worked for me. And thanks Oussama for pointing out the news on the new update, was stuck at that stage and couldn't get it to work.

AmarW15 avatar Feb 03 '25 12:02 AmarW15

Thanks @harley-dane npm i web-vitals --save-dev this is working, issue resolved

gulamzee avatar Feb 04 '25 10:02 gulamzee

@harley-dane thank you so much it's work's

MOHAMEDFALA avatar Feb 13 '25 19:02 MOHAMEDFALA