명

nodejs, npm 설치시 오류 해결

· 2011-12-05 (월) 10:09:37 · 4364 · 4
centos 에 nodejs, npm 설치하느라고 30분간 삽질한 후기.
 
1. 일단 tar 버전을 최신버전으로 컴파일한다. (http://firejune.com/1687?stag=tar 참고)
tar 버전을 1.26 으로 설치한다. 기존 설치된건 1.15 였다.
# w-get http://files1.directadmin.com/services/all/tar-1.26.tar.gz
# tar xvzf tar-1.26.tar.gz
# cd tar-1.26
# FORCE_UNSAFE_CONFIGURE=1
# export FORCE_UNSAFE_CONFIGURE
# ./configure
# make
# mv /bin/tar /bin/tar.old
# cp src/tar /bin/tar

2. npm 을 설치한다.
% curl http://npmjs.org/install.sh | sh
에러발생 

gzip: stdin: unexpected end of file
/usr/local/bin/tar: Child returned status 1
/usr/local/bin/tar: Error is not recoverable: exiting now
It failed

해결방법 : locale을 변경한다. (euckr 인 경우에 오류가 발생)
[root@localhost ~]# locale
LANG=ko_KR.eucKR
LC_CTYPE="ko_KR.eucKR"
LC_NUMERIC="ko_KR.eucKR"
LC_TIME="ko_KR.eucKR"
LC_COLLATE="ko_KR.eucKR"
LC_MONETARY="ko_KR.eucKR"
LC_MESSAGES="ko_KR.eucKR"
LC_PAPER="ko_KR.eucKR"
LC_NAME="ko_KR.eucKR"
LC_ADDRESS="ko_KR.eucKR"
LC_TELEPHONE="ko_KR.eucKR"
LC_MEASUREMENT="ko_KR.eucKR"
LC_IDENTIFICATION="ko_KR.eucKR"
LC_ALL=

%export LANG=en_US.UTF-8

Written by John Gilmore and Jay Fenlason.
0.6.2
1.0.106
cleanup prefix=/usr/local

All clean!
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/bin/npm-g -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/bin/npm_g -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
[email protected] /usr/local/lib/node_modules/npm
It worked

이제 제대로 설치되었다. 

괜히 30분간 삽질했네. 
 
핵심) 설치시 오류나면 tar 버전을 확인후 최신 버전으로 업데이트
         그래도 오류나면 locale 확인. UTF-8로 locale을 변경한다음 설치
|

댓글 4개

yum 설치는 없는것 같네요.
요즘 다른거 배울게 많아서 node.js 는 패스합니다.
2011-12-05 (월) 11:50:39
요즘 뭘 공부하시는지 궁금???????????????????
jQuery 조금씩 보고 있습니다.
설치한번 해봐야 하는데.....

진짜 짬이 없네요.
마음에 여유가 없어요

추천완료!!!!
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
16-03-02 조회 3,199
16-01-19 조회 2,487
15-12-23 조회 2,794
15-12-08 조회 3,597
14-10-30 조회 5,652
14-06-06 조회 5,481
12-08-30 조회 3,837
12-08-20 조회 3,765
12-07-15 조회 5,086
12-07-13 조회 3,569
12-07-06 조회 3,771
12-06-27 조회 3,308
12-06-23 조회 3,500
12-05-03 조회 5,126
12-04-20 조회 4,081
12-03-29 조회 4,563
12-03-22 조회 4,648
12-03-22 조회 3,453
12-03-21 조회 3,225
12-03-11 조회 3,669
12-03-06 조회 4,203
12-02-22 조회 4,486
12-02-17 조회 3,286
12-02-17 조회 6,129
12-02-14 조회 6,054
12-02-06 조회 4,208
12-01-18 조회 3,173
12-01-06 조회 3,395
11-12-30 조회 3,858
11-12-30 조회 6,997
11-12-21 조회 3,182
11-12-21 조회 4,192
11-12-16 조회 3,221
11-12-15 조회 3,263
11-12-15 조회 3,370
11-12-15 조회 4,167
11-12-09 조회 3,182
11-12-09 조회 3,262
11-12-07 조회 2,824
11-12-07 조회 3,914
11-12-05 조회 4,365
11-12-02 조회 3,803
11-12-01 조회 2,670
11-12-01 조회 2,711
11-12-01 조회 2,702