• 카테고리

    질문 & 답변
  • 세부 분야

    프론트엔드

  • 해결 여부

    해결됨

Macbook Air yarn 설치 실패

24.01.09 00:09 작성 조회수 108

0

안녕하세요 현재 MacBook Air 2022( macOS Sonoma | version 14 | Apple M1)으로 수강 중 입니다

yarn 설치시 오류가 발생합니다

Would you like to use TypeScript? … No / Yes

Would you like to use ESLint? … No / Yes

Would you like to use Tailwind CSS? … No / Yes

Would you like to use src/ directory? … No / Yes

Would you like to use App Router? (recommended) … No / Yes

Would you like to customize the default import alias (@/*)? … No / Yes

Creating a new Next.js app in /Users/namgyukim/Desktop/codecamp-frontend-NGK/class.

Using npm.

Initializing project with template: default

Installing dependencies:

- react

- react-dom

- next

added 22 packages, and audited 23 packages in 8s

3 packages are looking for funding

run npm fund for details

found 0 vulnerabilities

Initialized a git repository.

Success! Created class at /Users/namgyukim/Desktop/codecamp-frontend-NGK/class

npm notice

npm notice New patch version of npm available! 10.2.3 -> 10.2.5

npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.2.5

npm notice Run npm install -g npm@10.2.5 to update!

npm notice

namgyukim@NAMui-MacBookAir codecamp-frontend-NGK % cd class

namgyukim@NAMui-MacBookAir class % yarn add next@12.1.0 react@17.0.2 react-dom@17.0.2 --exact

zsh: command not found: yarn

namgyukim@NAMui-MacBookAir class % npm install -g yarn

npm ERR! code EACCES

npm ERR! syscall mkdir

npm ERR! path /usr/local/lib/node_modules/yarn

npm ERR! errno -13

npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/yarn'

npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/yarn'] {

npm ERR! errno: -13,

npm ERR! code: 'EACCES',

npm ERR! syscall: 'mkdir',

npm ERR! path: '/usr/local/lib/node_modules/yarn'

npm ERR! }

npm ERR!

npm ERR! The operation was rejected by your operating system.

npm ERR! It is likely you do not have the permissions to access this file as the current user

npm ERR!

npm ERR! If you believe this might be a permissions issue, please double-check the

npm ERR! permissions of the file and its containing directories, or try running

npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in: /Users/namgyukim/.npm/_logs/2024-01-08T14_45_08_725Z-debug-0.log

어떻게 해야 다음 단계로 넘어갈 수 있을까요?Screenshot 2024-01-08 at 09.08.47.png

답변 1

답변을 작성해보세요.

0

안녕하세요! NAM GYU님!

해당 에러를 자세히 보시면, permission denied 라는 에러 메시지를 확인하실 수 있어요!
이 에러 메시지는 권한이 없음을 의미한답니다!

 

해당 에러 메시지는 여러 상황에서 발생할 수 있어요!
그 중, 대표적으로는 현재 설치하려는 경로의 위치에 대한 권한이 없는 경우에 종종 발생한답니다!
예를 들면 맥북에 관리자계정과 철수계정이 있다고 한다면, 철수계정은 관리자가 아니기 때문에 해당 위치에 설치할 권한이 없다는 에러 메시지가 될 수 있겠죠?!^^

 

해결 방법으로는,
1. 해당 위치가 아닌 다른 폴더(게임, 작업파일 등을 설치할 때 주로 사용하시는 폴더)에서 설치하는 방법
2. 관리자권한을 잠시 빌려서 관리자권한으로 설치하는 방법(명령어 앞에 sudo를 붙이면 돼요!)

등이 있으며, 2번의 경우는 2차적인 또다른 문제가 발생할 수도 있으므로, 1번을 통해서 해결해 보세요!