• 카테고리

    질문 & 답변
  • 세부 분야

    프론트엔드

  • 해결 여부

    해결됨

[section04] cd class 이후 react 버전 변경시 오류

24.01.10 00:55 작성 조회수 75

0

cd class 이후 react 버전 변경 시 아래와 같은 오류가 진행됩니다. 어떻게 해결해야할까요..ㅠㅠ

Usage Error: The nearest package directory (C:\Users\user\Desktop\CodeCamp_Frontend_j\class) doesn't seem to be part of the project declared in C:\Users\user.

- If C:\Users\user isn't intended to be a project, remove any yarn.lock and/or package.json file there.

- If C:\Users\user is intended to be a project, it might be that you forgot to list Desktop/CodeCamp_Frontend_j/class in its workspace configuration.

- Finally, if C:\Users\user is fine and you intend Desktop/CodeCamp_Frontend_j/class to be treated as a completely separate project (not e

답변 1

답변을 작성해보세요.

0

안녕하세요! 재희님!

해당 프로젝트를 설치하기 위해서는 yarn install 등의 명령어를 사용해야 하는데요!
yarn install 명령어 사용시, 해당 폴더 내의 package.json과 yarn.lock 파일을 참고하여 설치가 된답니다!

 

그런데, 해당 폴더 밖에(상위 폴더) package.json 또는 yarn.lock이 있는 경우에는 yarn install 명령 입력시 컴퓨터가 헷갈려할 수가 있어요!

"여기다 설치 하라는거야? 위 폴더에다가 설치 하라는거야?"

 

따라서, 상위 폴더(위 에러메시지로 보아, /User/user 로 추정)의 package.json과 yarn.lock 등의 파일이 있는 경우라면, 삭제해 주시고 다시 한 번 시도해 보세요!^^