• Enter Slide 1 Title Here

    This is slide 1 description. Go to Edit HTML of your blogger blog. Find these sentences. You can replace these sentences with your own words.

  • Enter Slide 2 Title Here

    This is slide 2 description. Go to Edit HTML of your blogger blog. Find these sentences. You can replace these sentences with your own words.

  • Enter Slide 3 Title Here

    This is slide 3 description. Go to Edit HTML of your blogger blog. Find these sentences. You can replace these sentences with your own words.

Thursday, August 24, 2017

Without root/sudo permission install Node.js on Linux/CentOS

Node.js is a free and open source JavaScript runtime for server side programming. For *nix environments, users can do installations with RPMs or via package managers like yum. However, most often developers face restrictions during installation due to the need of root permission for directories like "/usr/local/bin". Here, we will be installing Node.js inside a directory under user_home.

1. Download binary distribution

Latest binaries can be downloaded from Node.js official release directory.

https://nodejs.org/download/release/
For CentOS 6.7, I downloaded Linux 64-bit binary of latest version (8.4.0) from below link.
https://nodejs.org/download/release/v8.4.0/node-v8.4.0-linux-x64.tar.gz
Make sure to pick suitable binary for your installation.

2. Extract into installation directory

This binary file must be extracted into the directory that you are installing Node.js. In my machine, I extracted it into below directory.
/home/user/software/nodejs_v8.4.0/

3. Add Node.js to PATH

It is required to append Node.js installation to PATH variable. For that, you can update either ~/.bash_profile or ~/.bashrc file as below.

export NODEJS_HOME=/home/user/software/nodejs_v8.4.0
export PATH=$PATH:$NODEJS_HOME/bin

4. Verify installation

Open up a console and check Node.js version to verify the installation as below.

bash$ node --version
v8.4.0
If you see the installed version as v8.4.0, that confirms the installation is completed. For this we did not use any additional *inx user privileges.

Related Articles

Tuesday, August 22, 2017

[Solved] Nginx - error: HTTP rewrite module requires the PCRE library

Nginx $ ./configure: error: the HTTP rewrite module requires the PCRE library. While trying to install Nginx server using the source distribution, "./configure" command failed on CentOS 6.7 with below error message. It complains that PCRE library is not available on the system.

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using
--without-http_rewrite_module option, or
install the PCRE library into the system,
or build the PCRE library statically from
the source with nginx by using --with-pcre=<path> option.

Solution

You can install this library either via command line or GUI.

Resolve via Command line

yum install pcre-devel

Resolve via GUI

Go to "System" -> "Administration" -> "Add/Remove Software" as shown below.

Then search for "pcre-devel", select "Development files for pcre" and install by clicking "Apply" as shown below.
After that, you can rerun the "./configure" command to continue installing Nginx 1.12.1 server.
Hope this helps.

Related Articles