[npm] yarn start 에러 해결

Seunghwa's Devlog·2023년 2월 24일
0
post-thumbnail

Admin 페이지에서 Banner 이미지가 보이지 않는다는 피드백을 받고 해결을 하려고 Admin 프로젝트 코드를 로컬에서 yarn start로 실행을 하는데,

There might be a problem with the project dependency tree. It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

"webpack": "4.29.6"

Don't try to install it manually: your package manager does it automatically. However, a different version of webpack was detected higher up in the tree:

...

이러한 오류가 발생했다.

처음보는 에러였고, 당황을 했는데 에러 로그에서 친절하게 해결방법을 단계별로 알려주어서 일단 따라해봤다.

 packge-lock.json delete
 yarn-lock.json delete
 node_module delete
 yarn install

이렇게 단계별로 진행하고 다시 yarn start를 했는데도 해결되지 않았다.

로그 마지막 부분에 .env파일에 SKIP_PREFLIGHT_CHECK=true를 추가하면 된다고 했는데 별로 추천하진 않는다고 해서 근본적인 해결방법을 찾고싶었다.

검색을 하다가 같은 에러를 겪는 사람의 글을 발견했는데, ~ 디렉토리에 node_modules를 삭제하고 실행하면 된다고 해서 그렇게 해봤다.

cd ~
rm -rf node_modules

해결되었다.

profile
에러와 부딪히고 새로운 것을 배우며 성장해가는 과정을 기록합니다!

0개의 댓글