[Vue.js] permission denied, mkdir '/usr/local/lib/node_modules/@vue' 에러 해결방법

반응형
반응형

 

npm i -g @vue/cli

 

npm notice 
npm notice New major version of npm available! 8.19.3 -> 9.2.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.2.0
npm notice Run npm install -g npm@9.2.0 to update!
npm notice 
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/@vue
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@vue'
npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@vue'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/lib/node_modules/@vue'
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:

원인: 설치를 할 때 해당 경로에 파일 쓰기 권한이 없기 때문

해결 : 다음처럼 명령어에 sudo_일반 사용자가 루트 권한을 임시로 획득하여 특정 명령을 가능케 하는 명령어_붙이니
비밀번호 입력 창 나오고, 해결 

sudo npm i -g @vue/cli

 

반응형

'Web' 카테고리의 다른 글

Static Site Generation  (0) 2023.01.22
CSR vs SSR비교  (0) 2023.01.21
intellij 파일트리 마침표  (0) 2023.01.08
intellij hot-deploy  (0) 2022.12.01
intellij 타임리프 th is not bound 에러 해결  (0) 2022.11.17

댓글

Designed by JB FACTORY

loading