• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    미해결

>npm install -g firebase-tools 에러

20.07.02 16:37 작성 조회수 827

0

명령어를 치면 아래와 같은 에러가 발생합니다

node버전은 v12.18.2 입니다 ㅜㅜ

>npm install -g firebase-tools

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules

npm ERR! code EACCES

npm ERR! syscall access

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

npm ERR! errno -13

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

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

npm ERR!   errno: -13,

npm ERR!   code: 'EACCES',

npm ERR!   syscall: 'access',

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

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/unggi/.npm/_logs/2020-07-02T07_33_57_911Z-debug.log

답변 2

·

답변을 작성해보세요.

0

Jun Ho  Yoon님의 프로필

Jun Ho Yoon

2020.12.07

-g 옵션을 제거해보세요. 저는 그렇게 success 가 되었습니다

0

안녕하세요?

일단 새로운 cloud functions 세계에 오신 걸 환영합니다. 저는 현재 프로젝트에서 머신러닝 관련 기능을 웹이나 앱에서 사용할 때도 cloud functions를 사용하고 있습니다.

질문 내용으로 돌아오면 일단 node가 버전 업그레이드에서 문제를 가끔 일으킵니다. 저도 유사한 경험을 했는데 특히 맥이나 리눅스 사용자들은 비슷한 에러를 만나게 됩니다. 제 추측으로는 기존에 node 10버전이 있는 상태에서 node12를 설치하시지 않았나 생각됩니다. 윈도우 같은 경우는 그렇게 하면 되는데 맥이나 리눅스는 그렇게 하면 유사한 에러가 나더라고요.

과정에서 보면 firebase cli에서 node 8버전을 쓰는데 정작 호스트에서는 10이상을 쓰라고 하는데 특히 4장에서 Vison Cloud API를 쓸 떄는 아예 사용이 안됩니다. 그래서 4장(머신러닝 Vision API)의 두 번째 단원에서 node 업그레이드 요령이 약 2분 40초 정도에 나옵니다. 맥과 리눅스의 정상적인 노드 업그레이드 방법을 설명하고 있으니 그 방법 데로 해보시고 만약 안되시면 알려주세요. 이마 node가 꼬인 상태이면 노드를 삭제하고 다시 설치하면 될 겁니다만 혼자하기 어려우시면 제가 도와드리겠습니다. 

강의 잘 들으시고 실전에도 잘 활용하시길 바랍니다.

감사합니다.