깃에서 리액트 프로젝트를 다운받고 npm start를 했을때 자주본 에러이다.

npm/node의 버전이 package.json에 설치된 버전과 안맞아서 그런줄알고 다시 설치해보고 삭제해보고 업데이트 해보고 이걸로 엄청 뻘짓 했는데 의외로 간단한 방법이 있었다.

 

해결방법

1. npm 캐시 삭제

npm cache clean -f   

 

2. node_modules, package-lock.json 삭제

방법1. 명령어로 삭제 

rm -rf node_modules   -> 이거슨 window에서 작동하지 않은듯 하다.

아래 명령어중 하나를 사용하면 된다.
rm -r node_modules
rm node_modules
rmdir node_modules /s /q

 

방법2. 폴더에서 -> 휴지통으로 

 

3. 재설치

npm install

 

728x90

+ Recent posts