npm install throws error for node-waf

starting from node version 0.8.0, node-waf has been removed and node-gyp is introduced. So npm is producing errors while trying to install the library.