공부

[React] Module not found: Error: Can't resolve 'web-vitals'

돌멩이수프 2025. 1. 24. 14:35
728x90

 

아무런 코드 추가 없이 기본 react 설치 후 npm start를 하니 해당 오류 발생

 

패키지가 꼬여서 발생한 문제

npm i web-vitals --save-dev

 

명령어를 통해 패키지를 없는 패키지를 다운받으니 문제 해결. 혹은 모듈을 전부 다시 받아도 해결된다고 합니다.

 

https://stackoverflow.com/questions/65396568/react-js-npm-start-shows-failed-to-compile-web-vitals

 

React JS npm start shows failed to compile web-vitals

I'm getting the error: failed to compile -/src/reportWebVitals.js Module not found: Can't resolve 'web-vitals'. Since new to react JS, could not find what happened. Here is the reportWebVitals.JS...

stackoverflow.com

 

728x90