반응형
- 권한이 없는 디렉토리에서 npm init 을 실행하면 다음 에러가 발생한다.
npm ERR! code EACCES
npm ERR! syscall open
npm ERR! path /bcs/app/ethereum_workspace/js/package.json
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, open '/bcs/app/ethereum_workspace/js/package.json'
npm ERR! [Error: EACCES: permission denied, open '/bcs/app/ethereum_workspace/js/package.json'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: '/bcs/app/ethereum_workspace/js/package.json'
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! /home/ec2-user/.npm/_logs/2022-03-30T05_05_33_967Z-debug-0.log
- 문제는 디렉토리에 others 에 대한 write 권한이 없어서 발생했다.
- 예를들면 js 디렉토리에서 npm init 을 하고싶다면 js 상위 디렉토리에서 다음 명령어를 입력하면 된다.
sudo chmod -R a+w js
- 명령어 설명:
-R
: js 및 하위 디렉토리에 대해a+w
: 모든 대상(user, group, other)에 대해 write 권한을 추가한다
반응형
'프로그램언어 > Javascript' 카테고리의 다른 글
nestjs dotenv 설정 (0) | 2022.05.19 |
---|---|
npm dependency 고정하기 (0) | 2022.05.18 |
node_modules 로컬 파일 바라보기 (0) | 2022.05.16 |
async 함수 throw catch (0) | 2022.05.10 |
hex String 형변환 (0) | 2022.03.24 |