Install nodejs4.4 with CentOS6.5 source code

Source: Internet
Author: User
This article records the installation of the latest stable version of nodejs under CentOS. The road is tortuous, but it is also a few hours of hard work, very satisfied. 1. download NodeJShttps from nodejs: // example

This article records the installation of the latest stable version of nodejs under CentOS. The road is tortuous, but it is also a few hours of hard work, very satisfied.

1. nodejs download

NodeJS https://nodejs.org/en/download/.

[Root @ test1 packages] # wget https://nodejs.org/dist/v4.4.0/node-v4.4.0.tar.gz

2. decompress

[Root @ test1 src] # tar-zxvf node-v4.4.0.tar.gz

[Root @ test1 src] # cd node-v4.4.0

3. Pre-compile

[Root @ test1 node-v4.4.0] #./configure -- prefix =/usr/local/nodejs

It is suggested that the c ++ version is too low.

4. Compile and report an error

5. upgrade gcc to version 4.8.

Reference http://ygqygq2.blog.51cto.com/1009869/1750612

6. compile again.

[Root @ test1 node-v4.4.0] # make

If an error occurs,

I checked the information and finally found that the answer to this post seemed correct.

Https://cnodejs.org/topic/568c8d9c04a9c540665c45a2

7. install binutils1 using the source code) use yum to check whether the problem can be solved.

The error is still the same

2) select the source code to install binutils.

Its:

Http://ftp.gnu.org/gnu/binutils/

[Root @ test1 packages] # wget http://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.gz

[Root @ test1 binutils-2.26] #./configure -- enable-shared -- enable-gold -- enable-ld

[Root @ test1 binutils-2.26] # make

[Root @ test1 binutils-2.26] # make install

8. re-compile nodejs

The problem changed during re-compilation, prompting that the library file does not support GLIBCXX_3.4.15.

Therefore, use yum to install libstdc ++ and libstdc ++-devel, and install the 32-bit version.

Error still... It seems that the library file is still faulty.

Again carry forward their search spirit, finally found this reference blog http://blog.chinaunix.net/uid-14735472-id-5546498.html

The idea is to soft link the loaded library file to the latest library file.

Check the dynamic library command:

Strings/usr/lib64/libstdc ++. so.6 | grep GLIBC

[Root @ test1 node-v4.4.0] # mv/usr/lib64/libstdc ++. so.6/tmp/

Finally, the above prompt library file version error is supported.

7. Compile and install nodejs and view the version

[Root @ test1 node-v4.4.0] # make

[Root @ test1 node-v4.4.0] # make install

[Root @ test1 node-v4.4.0] #/usr/local/nodejs/bin/node-v

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.