npm install -g @vue/cli
를 사용해서 뷰 Cli를 설치하려는데 아래와 같은 에러가 발생했다.
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! 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.
해당 에러는 글로벌 설치에 대해 권한이 없기 때문에 발생한 것이므로 sudo
를 앞에 붙여서 설치하면 된다.
sudo npm install -g @vue/cli
password가 뜨면 비밀번호를 입력 후 엔터.