본문 바로가기

TroubleShooting/Linux

NodeJS 설치 on CentOS 7

728x90

NodeJS 설치 on CentOS 7


CentOS 7 에서 nodejs 를 설치하려면 다음과 같은 오류를 만난다. (설치된 CentOS 버전 : 7.2.X)


# yum install nodejs npm

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

 * base: ftp.daumkakao.com

 * epel: mirror.premi.st

 * extras: ftp.daumkakao.com

 * updates: ftp.daumkakao.com

Resolving Dependencies

--> Running transaction check

---> Package nodejs.x86_64 1:6.11.1-1.el7 will be installed

--> Processing Dependency: libuv >= 1:1.9.1 for package: 1:nodejs-6.11.1-1.el7.x86_64

--> Processing Dependency: http-parser >= 2.7.0 for package: 1:nodejs-6.11.1-1.el7.x86_64

--> Processing Dependency: libuv.so.1()(64bit) for package: 1:nodejs-6.11.1-1.el7.x86_64

--> Processing Dependency: libhttp_parser.so.2()(64bit) for package: 1:nodejs-6.11.1-1.el7.x86_64

---> Package npm.x86_64 1:3.10.10-1.6.11.1.1.el7 will be installed

--> Running transaction check

---> Package libuv.x86_64 1:1.10.2-1.el7 will be installed

---> Package nodejs.x86_64 1:6.11.1-1.el7 will be installed

--> Processing Dependency: http-parser >= 2.7.0 for package: 1:nodejs-6.11.1-1.el7.x86_64

--> Processing Dependency: libhttp_parser.so.2()(64bit) for package: 1:nodejs-6.11.1-1.el7.x86_64

--> Finished Dependency Resolution

Error: Package: 1:nodejs-6.11.1-1.el7.x86_64 (epel)

           Requires: libhttp_parser.so.2()(64bit)

Error: Package: 1:nodejs-6.11.1-1.el7.x86_64 (epel)

           Requires: http-parser >= 2.7.0

 You could try using --skip-broken to work around the problem

 You could try running: rpm -Va --nofiles --nodigest

#


 libhttp_parser 디펜던시(라이브러리)가 필요하다고 하면서 종료된다. 그래서 http-parser 설치하려고하면 없다.

# yum install http-parser

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

 * base: ftp.daumkakao.com

 * epel: mirror.premi.st

 * extras: ftp.daumkakao.com

 * updates: ftp.daumkakao.com

No package http-parser available.

Error: Nothing to do


 다음과 같이 http-parser 패키지를 받고 나서 다시 설치하면 된다.

# rpm -ivh https://kojipkgs.fedoraproject.org//packages/http-parser/2.7.1/3.el7/x86_64/http-parser-2.7.1-3.el7.x86_64.rpm

https://kojipkgs.fedoraproject.org//packages/http-parser/2.7.1/3.el7/x86_64/http-parser-2.7.1-3.el7.x86_64.rpm(을)를 복구합니다

준비 중...                         ################################# [100%]

Updating / installing...

   1:http-parser-2.7.1-3.el7          ################################# [100%]


nodejs 설치

# yum install nodejs

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

 * base: ftp.daumkakao.com

 * epel: mirror.premi.st

 * extras: ftp.daumkakao.com

 * updates: ftp.daumkakao.com

Resolving Dependencies

--> Running transaction check

---> Package nodejs.x86_64 1:6.11.1-1.el7 will be installed

--> Processing Dependency: npm = 1:3.10.10-1.6.11.1.1.el7 for package: 1:nodejs-6.11.1-1.el7.x86_64

--> Processing Dependency: libuv >= 1:1.9.1 for package: 1:nodejs-6.11.1-1.el7.x86_64

--> Processing Dependency: libuv.so.1()(64bit) for package: 1:nodejs-6.11.1-1.el7.x86_64

--> Running transaction check

---> Package libuv.x86_64 1:1.10.2-1.el7 will be installed

---> Package npm.x86_64 1:3.10.10-1.6.11.1.1.el7 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


==========================================================================================================================================================================================

 Package                                 Arch                                    Version                                                      Repository                             Size

==========================================================================================================================================================================================

Installing:

 nodejs                                  x86_64                                  1:6.11.1-1.el7                                               epel                                  4.5 M

Installing for dependencies:

 libuv                                   x86_64                                  1:1.10.2-1.el7                                               epel                                  109 k

 npm                                     x86_64                                  1:3.10.10-1.6.11.1.1.el7                                     epel                                  2.5 M


Transaction Summary

==========================================================================================================================================================================================

Install  1 Package (+2 Dependent packages)


Total download size: 7.1 M

Installed size: 26 M

Is this ok [y/d/N]: y


도움받은 곳

https://bugs.centos.org/view.php?id=13669