How do I install websocket module for Node.js on Debian VPS?

I have successfully installed Node.js, now I want to install the websocket module found here: https://github.com/Worlize/WebSocket-Node

From the root user, I have run the following command:

 npm install websocket

The error thrown is:

[websocket v1.0.7]

Native code compile failed!!

On Windows, native extensions require Visual Studio and Python.

On Unix, native extensions require Python, make and a C++ compiler.

Start npm with --websocket:verbose to show compilation output (if any).

What commands should I issue to install this websocket module and its requirements?

Edit: When I run sudo apt-get install gcc make

I get this message:

Reading package lists... Done Building dependency tree Reading state information... Done gcc is already the newest version. gcc set to manually installed. make is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 44 not upgraded.

And the same error when trying to install WebSocket.

If you see the install.js, this error is because you got problems with node-gyp. Try "sudo npm install -g node-gyp" and run your commands again.

Make sure that you have installed python, make and gcc. Python should be already installed by default. You can install gcc and make as root with command:

apt-get install gcc make

apt-get g++

fixed my problem, very nice!

My problem: python version. I have installed python 2.4.3 instead python 2.7 (required for websocket).

I install python2.7 with make altinstall and create a symbolic link for replace python script:

ln -s /usr/local/bin/python2.7 /usr/bin/python

And works for me:

# npm install websocket --websocket:verbose

[websocket v1.0.8] Attempting to compile native extensions.
gyp http GET http://nodejs.org/dist/v0.10.15/node-v0.10.15.tar.gz
gyp http 200 http://nodejs.org/dist/v0.10.15/node-v0.10.15.tar.gz
make: Entering directory `********/node_modules/websocket/build'
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/obj.target/validation.node
  SOLINK_MODULE(target) Release/obj.target/validation.node: Finished
  COPY Release/validation.node
  CXX(target) Release/obj.target/xor/src/xor.o
  SOLINK_MODULE(target) Release/obj.target/xor.node
  SOLINK_MODULE(target) Release/obj.target/xor.node: Finished
  COPY Release/xor.node
make: Leaving directory `*******/node_modules/websocket/build'
[websocket v1.0.8] Native extension compilation successful!