Error: spawn ENOTSUP when installing socket.io with npm install

If you have installed node.js v0.6.16 for Windows and you want to install socket.io with the following command:

npm install socket.io

Then it could happen that you will get this error message on Windows 7 (64-Bit):

> node install.js
 
npm ERR! Error: spawn ENOTSUP
npm ERR!     at errnoException (child_process.js:483:11)
npm ERR!     at ChildProcess.spawn (child_process.js:446:11)
npm ERR!     at Object.spawn (child_process.js:342:9)
npm ERR!     at spawn (C:\Program Files (x86)\nodejs\node_mod
npm ERR!     at exec (C:\Program Files (x86)\nodejs\node_modu
npm ERR!     at Array.0 (C:\Program Files (x86)\nodejs\node_m
npm ERR!     at EventEmitter._tickCallback (node.js:192:40)

Fortunately, there is a solution! Open this file:

C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\exec.js

Replace these two lines (around line 109 & 110):

  if (!isNaN(uid)) opts.uid = uid
  if (!isNaN(gid)) opts.gid = gid

That’s all. For more information see: Error on socket.io installing on Windows 7.

With these ones:

  if (uid && !isNaN(uid)) opts.uid = +uid
  if (gid && !isNaN(gid)) opts.gid = +gid

How to install node.js on a Debian server

How to install node.js (latest version)

apt-get install g++ curl libssl-dev apache2-utils git-core -y
cd /etc
git clone git://github.com/joyent/node
cd /etc/node
./configure
make
sudo make install

How to install node.js (stable version)

apt-get install g++ curl libssl-dev apache2-utils git-core -y
cd /tmp
wget http://nodejs.org/dist/v0.6.11/node-v0.6.11.tar.gz
tar xvf node-v0.6.11.tar.gz
mv /tmp/node-v0.6.11 /etc
cd /etc/node-v0.6.11
./configure
make
sudo make install
rm /tmp/node-v0.6.11.tar.gz

You can check the installed version with node --version.

node.js package manager

If you want to use a package manager for node.js (like npm), then you can get it with:

curl http://npmjs.org/install.sh | sh

To use the package manager, just go into your node.js webproject and execute something like:

npm install websocket.io

This command will load the desired dependencies (like websocket.io) into a directory called „node_modules“ within your project’s folder.

Uninstalling node.js

To uninstall node.js, just go to the folder where you installed node.js (e.g. /tmp/node-v0.6.11) and use the following command:

make uninstall