Installation

The first step before attempting to install node is to get python2 installed on your machine. You will get this error if python2 is not installed.

File "./configure", line 329

You might also run into this error: unable to lock database Run sudo rm /var/lib/pacman/db.lck to remove the database lock file.

Steps

First run sudo pacman -S python2

Then in your text editor open the following file to create a symbolic link:

/usr/bin/python

Change the line #!/usr/bin/python to python2

Another way to do this would be by creating a symlink from the terminal:

cd /usr/bin Crete the symlink ln -sf python2 python

Then install Node.js from source.

Go to the node homepage and download the source code from the downloads section.

I will look something like this: Source code node-v0.10.34.tar.gz

Then cd into the downloads directory and run the following commands:

tar -xvf node-v0.10.34.tar.gz this will extract the contents of the tar ball.

cd node-v0.10.34

./configure --prefix=~/.node

make && make install

Once the whole process is done add the following to your shell startup scripts(.bash_profile, .bashrc or .profile)

export PATH=$PATH:$HOME/.node/bin

export NODE_PATH=$HOME/.node/lib/node_modules

Restart the terminal and run node -v this should print out the current node version.

Finally pad yourself on the back and congratulate yourself. You are starting your journey as a Full Stack JavaScript Developer.

Last updated

Was this helpful?