Carol Gonzalez Carol Gonzalez - 1 month ago 5
Bash Question

Installing Node in a linux grid server

So some background, I'm installing Node on a host server, but it's a grid server not a server that's solely for my website.

The grid server doesn't have a root user/ administrative powers. So to install node I found this workaround: http://iantearle.com/blog/media-temple-grid-and-nodejs . It's a Linux Grid server, I've never used Linux so if someone could explain to me what the commands mean, especially:

./configure --prefix=~/opt/


Lastly I followed the steps but when I try to run the
node
command in the server it says
node:command not found
- which is why I'm trying to understand the steps. Thanks

Answer

To explain the process:

  1. Configure

The configure script is responsible for getting ready to build the software on your specific system. It makes sure all of the dependencies for the rest of the build and install process are available, and finds out whatever it needs to know to use those dependencies.

Unix programs are often written in C, so we’ll usually need a C compiler to build them. In these cases the configure script will establish that your system does indeed have a C compiler, and find out what it’s called and where to find it.

  1. Make

Once configure has done its job, we can invoke make to build the software. This runs a series of tasks defined in a Makefile to build the finished program from its source code.

The tarball you download usually doesn’t include a finished Makefile. Instead it comes with a template called Makefile.in and the configure script produces a customised Makefile specific to your system.

3.Make Install

Now that the software is built and ready to run, the files can be copied to their final destinations. The make install command will copy the built program, and its libraries and documentation, to the correct locations.

--prefix=~/opt/ -> will set the build directory to /home/yourhome/opt directory.

Now if you didnt get errors while doing those 3 steps explained above make sure you did the following:

nano ~/.bash_profile
export PATH=~/opt/bin:${PATH}

nano is a text editor and you are opening .bash_profile file with it. you need to add export PATH=~/opt/bin:${PATH} in that file and save it using ctrl+x

Then restart your terminal.

P.S node:command not found usually happens when the program is not installed correctly or it's executable isnt in your terminal's PATH variable.