install socket.io on ubuntu install socket.io on ubuntu node.js node.js

install socket.io on ubuntu


I ran those commands and it worked:

  1. sudo npm install -g n
  2. sudo n 0.8.15
  3. sudo npm install socket.io


You're trying to install it without a package.json file, and in your solution you installed it globally, which is usually not what you want for socket.io.

Instead, you should include a package.json file in your working directory and either run:

> npm install socket.io --save

which will automatically append it to package.json, or your you can physically include it in the dependencies and then just run:

> npm install


It worked:

1) sudo npm install -g n
2) sudo n 0.8.15
3) sudo npm install socket.io