1. And install some of the necessary packages for node. js
Yum-y install gcc make gcc-c++ openssl-devel wget
2. Get the source code for node. js
After installing the dependency package we can download the source code of node. JS from the official website and unzip the command as follows:
wget https://
3. Unzip
Tar zxvf node-v8.7.0.tar.gz
4. Compile and install:
Go to the Unpacked folder for example:
CD node-v8.7.0
Perform:
Enter the source code directory, and then run the./configure file
./configure
Make install
Results:
installing/usr/local/lib/node_modules/npm/html/doc/files/npmrc.htmlinstalling/usr/local/lib/node_modules/npm/ html/doc/files/package-lock.json.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/files/ npm-package-locks.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-prefix.htmlinstalling/usr/ local/lib/node_modules/npm/html/doc/cli/npm-doctor.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/ npm-owner.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-star.htmlinstalling/usr/local/lib/ node_modules/npm/html/doc/cli/npm-help-search.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/ Npm-test.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-pack.htmlinstalling/usr/local/lib/node _modules/npm/html/doc/cli/npm-cache.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/ Npm.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-deprecate.htmlinstalling/usr/local/lib/node _modules/npm/html/doc/cli/npm-bin.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-help.htmlinstalling/usr/local/lib/node_modules/npm/ Html/doc/cli/npm-edit.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-whoami.htmlinstalling/usr /local/lib/node_modules/npm/html/doc/cli/npm-repo.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/ npm-team.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-dist-tag.htmlinstalling/usr/local/lib/ node_modules/npm/html/doc/cli/npm-uninstall.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/ npm-rebuild.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-restart.htmlinstalling/usr/local/ lib/node_modules/npm/html/doc/cli/npm-unpublish.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/ npm-view.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-run-script.htmlinstalling/usr/local/ lib/node_modules/npm/html/doc/cli/npm-docs.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/ Npm-link.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-dedupe.htmlinstalling/usr/local/lib/node_modules/npm/html/ doc/cli/npm-bundle.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-ping.htmlinstalling/usr/ local/lib/node_modules/npm/html/doc/cli/npm-search.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/ npm-ls.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-completion.htmlinstalling/usr/local/lib/ node_modules/npm/html/doc/cli/npm-install-test.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/ npm-update.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-access.htmlinstalling/usr/local/lib/ node_modules/npm/html/doc/cli/npm-prune.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/ npm-logout.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-start.htmlinstalling/usr/local/lib/ node_modules/npm/html/doc/cli/npm-shrinkwrap.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/ Npm-publish.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-bugs.htmlinstalling/usr/local/lib/node_modules/npm/html/ doc/cli/npm-version.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-stars.htmlinstalling/usr/ local/lib/node_modules/npm/html/doc/cli/npm-init.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/ Npm-outdated.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-build.htmlinstalling/usr/local/lib /node_modules/npm/html/doc/cli/npm-root.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/ Npm-explore.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-config.htmlinstalling/usr/local/lib /node_modules/npm/html/doc/cli/npm-adduser.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/ npm-stop.htmlinstalling/usr/local/lib/node_modules/npm/html/doc/cli/npm-install.htmlinstalling/usr/local/lib/ node_modules/npm/html/static/style.cssinstalling/usr/local/lib/node_modules/npm/html/static/toc.jsinstalling/usr/local/lib/node_modules/npm/.github/issue_template.mdinstalling/usr/local/lib/node_modules/npm/.github/ Codeownerssymlinking. /lib/node_modules/npm/bin/npm-cli.js-/usr/local/bin/npmsymlinking. /lib/node_modules/npm/bin/npx-cli.js-/usr/local/bin/npxinstalling/usr/local/include/node/ Common.gypiinstalling/usr/local/include/node/config.gypiinstalling/usr/local/include/node/node.hinstalling/usr /local/include/node/node_api.hinstalling/usr/local/include/node/node_api_types.hinstalling/usr/local/include/ Node/node_buffer.hinstalling/usr/local/include/node/node_object_wrap.hinstalling/usr/local/include/node/node_ Version.hinstalling/usr/local/include/node/v8-util.hinstalling/usr/local/include/node/v8-inspector.hinstalling /usr/local/include/node/v8-inspector-protocol.hinstalling/usr/local/include/node/v8config.hinstalling/usr/ local/include/node/v8-platform.hinstalling/usr/local/include/node/v8-profiler.hinstalling/usr/local/include/ Node/v8-version-string.hinstallinG/usr/local/include/node/v8-value-serializer-version.hinstalling/usr/local/include/node/v8-testing.hinstalling /usr/local/include/node/v8.hinstalling/usr/local/include/node/v8-debug.hinstalling/usr/local/include/node/ v8-version.hinstalling/usr/local/include/node/libplatform/v8-tracing.hinstalling/usr/local/include/node/libplatform/libplatform-export.hinstalling/usr/local/include/node/libplatform/libplatform.hinstalling/usr/local/include/node/uv-linux.hinstalling/usr/local/include/node/stdint-msvc2008.hinstalling/usr/local/ include/node/uv-threadpool.hinstalling/usr/local/include/node/tree.hinstalling/usr/local/include/node/ Uv-posix.hinstalling/usr/local/include/node/uv-errno.hinstalling/usr/local/include/node/uv-win.hinstalling/usr /local/include/node/pthread-barrier.hinstalling/usr/local/include/node/uv-bsd.hinstalling/usr/local/include/ Node/uv.hinstalling/usr/local/include/node/uv-unix.hinstalling/usr/local/include/node/uv-sunos.hinstalling/usr /local/include/node/uv-darwin.hinstalling/usr/local/include/node/uv-os390.hinstalling/usr/local/include/node/ uv-aix.hinstalling/usr/local/include/node/android-ifaddrs.hinstalling/usr/local/include/node/ uv-version.hinstalling/usr/local/include/node/openssl/modes.hinstalling/usr/local/include/node/openssl/pkcs12.hinstalling/usr/local/include/node/openssl/buffer.hinstalling/usr/local/include/node/openssl/whrlpool.hinstalling/usr/local/include/node/openssl/camellia.hinstalling/usr/local/include/node/openssl/opensslconf.hinstalling/usr/local/include/node/openssl/kssl.hinstalling/usr/local/include/node/openssl/rc2.hinstalling/usr/local/include/node/openssl/ecdh.hinstalling/usr/local/include/node/openssl/ssl23.hinstalling/usr/local/include/node/openssl/ebcdic.hinstalling/usr/local/include/node/openssl/blowfish.hinstalling/usr/local/include/node/openssl/asn1t.hinstalling/usr/local/include/node/openssl/idea.hinstalling/usr/local/include/node/openssl/asn1.hinstalling/usr/local/include/node/openssl/ui.hinstalling/usr/local/include/node/openssl/x509_vfy.hinstalling/usr/local/include/node/openssl/ts.hinstalling/usr/local/include/node/openssl/pem.hinstalling/usr/local/include/node/openssl/lhash.hinstalling/usr/local/include/node/openssl/dh.hinstalling/usr/local/include/node/openssl/srp.hinstalling/usr/local/include/node/openssl/objects.hinstalling/usr/local/include/node/openssl/safestack.hinstalling/usr/local/include/node/openssl/bn.hinstalling/usr/local/include/node/openssl/txt_db.hinstalling/usr/local/include/node/openssl/dtls1.hinstalling/usr/local/include/node/openssl/rand.hinstalling/usr/local/include/node/openssl/ssl3.hinstalling/usr/local/include/node/openssl/bio.hinstalling/usr/local/include/node/openssl/x509.hinstalling/usr/local/include/node/openssl/seed.hinstalling/usr/local/include/node/openssl/crypto.hinstalling/usr/local/include/node/openssl/cmac.hinstalling/usr/local/include/node/openssl/sha.hinstalling/usr/local/include/node/openssl/ssl.hinstalling/usr/local/include/node/openssl/krb5_asn.hinstalling/usr/local/include/node/openssl/ripemd.hinstalling/usr/local/include/node/openssl/rc4.hinstalling/usr/local/include/node/openssl/rsa.hinstalling/usr/local/include/node/openssl/md4.hinstalling/usr/local/include/node/openssl/pem2.hinstalling/usr/local/include/node/openssl/e_os2.hinstalling/usr/local/include/node/openssl/ssl2.hinstalling/usr/local/include/node/openssl/evp.hinstalling/usr/local/include/node/openssl/conf_api.hinstalling/usr/local/include/node/openssl/obj_mac.hinstalling/usr/local/include/node/openssl/err.hinstalling/usr/local/include/node/openssl/des.hinstalling/usr/local/include/node/openssl/pkcs7.hinstalling/usr/local/include/node/openssl/cms.hinstalling/usr/local/include/node/openssl/md5.hinstalling/usr/local/include/node/openssl/ec.hinstalling/usr/local/include/node/openssl/srtp.hinstalling/usr/local/include/node/openssl/dsa.hinstalling/usr/local/include/node/openssl/stack.hinstalling/usr/local/include/node/openssl/dso.hinstalling/usr/local/include/node/openssl/ocsp.hinstalling/usr/local/include/node/openssl/hmac.hinstalling/usr/local/include/node/openssl/pqueue.hinstalling/usr/local/include/node/openssl/conf.hinstalling/usr/local/include/node/openssl/ecdsa.hinstalling/usr/local/include/node/openssl/opensslv.hinstalling/usr/local/include/node/openssl/engine.hinstalling/usr/local/include/node/openssl/ui_compat.hinstalling/usr/local/include/node/openssl/des_old.hinstalling/usr/local/include/node/openssl/ossl_typ.hinstalling/usr/local/include/node/openssl/cast.hinstalling/usr/local/include/node/openssl/aes.hinstalling/usr/local/include/node/openssl/symhacks.hinstalling/usr/local/include/node/openssl/x509v3.hinstalling/usr/local/include/node/openssl/tls1.hinstalling/usr/local/include/node/openssl/asn1_mac.hinstalling/usr/local/include/node/openssl/comp.hinstalling/usr/local/include/node/openssl/mdc2.hinstalling/usr/local/include/node/openssl/archs/vc-win64a/opensslconf.hinstalling/usr/local/include/node/openssl/archs/linux32-s390x/opensslconf.hinstalling/usr/local/include/node/openssl/archs/bsd-x86/opensslconf.hinstalling/usr/local/include/node/openssl/archs/solaris-x86-gcc/opensslconf.hinstalling/usr/local/include/node/openssl/archs/linux-ppc/opensslconf.hinstalling/usr/local/include/node/openssl/archs/linux-armv4/opensslconf.hinstalling/usr/local/include/node/openssl/archs/linux-ppc64/opensslconf.hinstalling/usr/local/include/node/openssl/archs/darwin64-x86_64-cc/opensslconf.hinstalling/usr/local/include/node/openssl/archs/linux-x86_64/opensslconf.hinstalling/usr/local/include/node/openssl/archs/linux-elf/opensslconf.hinstalling/usr/local/include/node/openssl/archs/aix-gcc/opensslconf.hinstalling/usr/local/include/node/openssl/archs/linux64-s390x/opensslconf.hinstalling/usr/local/include/node/openssl/archs/linux-aarch64/opensslconf.hinstalling/usr/local/include/node/openssl/archs/darwin-i386-cc/opensslconf.hinstalling/usr/local/include/node/openssl/archs/solaris64-x86_64-gcc/opensslconf.hinstalling/usr/local/include/node/openssl/archs/bsd-x86_64/opensslconf.hinstalling/usr/local/include/node/openssl/archs/aix64-gcc/opensslconf.hinstalling/usr/local/include/node/openssl/archs/linux-x32/opensslconf.hinstalling/usr/local/include/node/openssl/archs/vc-win32/opensslconf.hinstalling/usr/local/include/node/openssl/opensslconf.hinstalling/usr/local/include/node/zconf.hinstalling/usr/local/include/node/zlib.h
Perform:
[Email protected] node-v8.7.0]# node-v
and Npm-v
Results
v8.7.0
If NPM doesn't work, perform
Make install NPM or curl-l https://www.npmjs.com/install.sh | Sh
Centos installation NodeJS