npm ERR! Please try running this command again as root/Administrator.
node.js 개발 환경을 세팅하기 위해 npm으로 goorm(구름) IDE를 설치 중 아래와 같은 에러가 발생했습니다.
Ahnui-Mac-mini:MacintoshHD2 ahnsanghak$ npm install goorm -g
npm http GET https://registry.npmjs.org/goorm
npm http 200 https://registry.npmjs.org/goorm
npm http GET https://registry.npmjs.org/goorm/-/goorm-1.0.9a-r203.tgz
npm http 200 https://registry.npmjs.org/goorm/-/goorm-1.0.9a-r203.tgz
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/goorm'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/goorm']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/goorm',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/goorm',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ 'DirWriter._create (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23)',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
npm ERR! 'Object.oncomplete (fs.js:297:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "goorm" "-g"
npm ERR! cwd /Volumes/MacintoshHD2
npm ERR! node -v v0.8.19
npm ERR! npm -v 1.2.10
npm ERR! path /usr/local/lib/node_modules/goorm
npm ERR! fstream_path /usr/local/lib/node_modules/goorm
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/local/lib/node_modules/goorm'
npm ERR! fstream_stack DirWriter._create (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23)
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:297:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Volumes/MacintoshHD2/npm-debug.log
npm ERR! not ok code 0
해결책은 간단합니다. sudo로 어드민 권한으로 설치하는 것이죠. 맥이나 리눅스를 많이 접하신 분들에겐 별 문제 아닌 듯 하지만, 저 같은 초보분을 위해 정리를 해봤습니다.
sudo npm install goorm -g
꼭 구름이 아니더라도 npm으로 패키지를 설치할 때 위와 같은 에러가 발생하면 같은 방법으로 해결이 가능할 듯 합니다.
Ahnui-Mac-mini:MacintoshHD2 ahnsanghak$ npm install goorm -g
npm http GET https://registry.npmjs.org/goorm
npm http 200 https://registry.npmjs.org/goorm
npm http GET https://registry.npmjs.org/goorm/-/goorm-1.0.9a-r203.tgz
npm http 200 https://registry.npmjs.org/goorm/-/goorm-1.0.9a-r203.tgz
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/goorm'
npm ERR! { [Error: EACCES, mkdir '/usr/local/lib/node_modules/goorm']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/goorm',
npm ERR! fstream_type: 'Directory',
npm ERR! fstream_path: '/usr/local/lib/node_modules/goorm',
npm ERR! fstream_class: 'DirWriter',
npm ERR! fstream_stack:
npm ERR! [ 'DirWriter._create (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23)',
npm ERR! '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
npm ERR! 'Object.oncomplete (fs.js:297:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "goorm" "-g"
npm ERR! cwd /Volumes/MacintoshHD2
npm ERR! node -v v0.8.19
npm ERR! npm -v 1.2.10
npm ERR! path /usr/local/lib/node_modules/goorm
npm ERR! fstream_path /usr/local/lib/node_modules/goorm
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/local/lib/node_modules/goorm'
npm ERR! fstream_stack DirWriter._create (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23)
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:297:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Volumes/MacintoshHD2/npm-debug.log
npm ERR! not ok code 0
해결책은 간단합니다. sudo로 어드민 권한으로 설치하는 것이죠. 맥이나 리눅스를 많이 접하신 분들에겐 별 문제 아닌 듯 하지만, 저 같은 초보분을 위해 정리를 해봤습니다.
sudo npm install goorm -g
꼭 구름이 아니더라도 npm으로 패키지를 설치할 때 위와 같은 에러가 발생하면 같은 방법으로 해결이 가능할 듯 합니다.
댓글
댓글 쓰기