💣 permission denied, mkdir … yarn

yarn install 할 시 permission error 발생.
당연히 npm 으로 yarn 을 설치하지 못했으니 yarn install 해도 yarn 을 찾을 수 없다는 에러뿐.

첫번째 시도
위의 코드 작성 후 yarn 설치는 되었으나 command not found:yarn 에러는 계속 떴다.

두번째 시도
설치된 yarn을 삭제 후 재 설치 해보기로 함.
brew list 에서 설치된 yarn 확인 후 brew uninstall yarn 으로 삭제.


나중에 안 사실이지만 node 버전이 16.10 이상이면 corepack enable 로 설치를 해야 한다.


이후 yarn install 하면 에러가 해결된다.
결론
1. node version 을 확인한다. 2. 해당 버전과 package 의 업그레이드 된 내용이 있는지 파악 및 검색 3. permission error 가 난다면 sudo 를 작성한다.