• 카테고리

    질문 & 답변
  • 세부 분야

    프론트엔드

  • 해결 여부

    미해결

npm install -g serve 설치 오류가 납니다..ㅠㅠ

23.02.19 16:27 작성 조회수 734

1

hyunwooji@jihyeon-uui-MacBook-Air emotiondiary % npm install -g serve

npm WARN config global --global, --local are deprecated. Use --location=global instead.

npm ERR! code EACCES

npm ERR! syscall mkdir

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

npm ERR! errno -13

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

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

npm ERR! errno: -13,

npm ERR! code: 'EACCES',

npm ERR! syscall: 'mkdir',

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

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:

npm ERR! /Users/hyunwooji/.npm/_logs/2023-02-19T07_24_53_420Z-debug-0.log

 

 

구글링 해봣을때는 npm 업데이트 문제인거같다고로 찾아서

npm update 도 해봣는데 전혀 해결되지 않고 더 꼬이고 있는거같습니다..

 

완강을 앞두고 좌절중이네요ㅠ 오늘 다 완강하고 싶었는데 도저히 해결이 안되어 질문남깁니다

 

감사합니다!!

답변 1

답변을 작성해보세요.

6

안녕하세요 이정환입니다.

맥북을 사용하고 계시는군요

에러 메세지를 읽어보면 "permission denied ... " 메세지가 보입니다.

위 오류 메세지는 권한이 거부되었다 라고 이해할 수 있는데요

이럴 경우 명령어 앞에 sudo를 붙여 루트 권한으로 명령어를 실행해 주셔야합니다.

sudo npm install -g serve

이렇게 입력할 경우 비밀번호를 물어보게 되는데 사용하고 계신 PC의 비밀번호를 입력해주시면 됩니다.

npm 의 경우 -g 옵션을 붙여 글로벌 모듈을 설치할 때 맥북에서 보통 이렇게 관리자 권한을 요구하고는 하니 참고 하시면 도움 될 것 같습니다 😃

감사합니다.

감사합니다 직접 설명해주시다니요.. 수업이 이제 3개 남았었는데 끝까지 완주하겠습니다

다시한번 감사드립니다!

Roy13님의 프로필

Roy13

2023.06.18

감사합니다. 저도 같은 걸로 곤란했었는데.^^