Error installing node-gyp on ubuntu

Solution 1:

If your python version isn't the source of error, check if you have "gyp" installed. This is conflicting with the gyp version in node-gyp.

apt-get remove gyp

https://github.com/TooTallNate/node-gyp/issues/363#issuecomment-32234646

Solution 2:

This command sudo apt-get install build-essential helped in my case.

Solution 3:

This is what worked. You need python 2.6 during the installation.

#!/bin/bash
#On Ubuntu Saucy:
sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get install python2.6
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.6 20
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10

#you can switch between 2.6 & 2.7 using:
sudo update-alternatives --config python

#Btw I installed node using ppa:chris-lea/node.js

https://github.com/TooTallNate/node-gyp/issues/363