Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / web / Node.js

How to Install Socket.io on Node.js on Windows

1.67/5 (2 votes)
12 Oct 2015CPOL1 min read 34.6K  
Installing socket.io on node.js on Windows 8

Introduction

This tip is about installing socket.io on node.js on Windows 8. We (me and my colleague Ahmed Damak) worked on this as part of a project in the fourth year in university. There is no good install guide for socket.io on node.js on the internet, so we decide to make it happen.

Background

Node.js can make working with Websockets very easy when using the Socket.io library. Using websockets, you can easily build realtime applications like chat box. Today, we will show you how to easily install the library to build a simple program using Node.js and Socket.io.

Note: To go through this tip, you will need to download Node.js.

Install Guide

You create a folder that will encapsulate the node.js server part of the project as socketioexemple folder name. Put yourself in the project file created earlier "socketioexemple" and run the command:

npm install socket.io 

This command installs the project folder in the library socket.io. In this case, it is only available for the project.

Image 1

After we did the test node app.js, make sure to place it in the folder in which the script was created app.js. But the console will display such error due to lack of other files. You should follow the approach given below.

Note: After the launch of each installation must verify connectivity of the server where the files are missing.

Image 2

install socket.io-parser

Image 3

Image 4

Install debug

Image 5

Installation has-binary-data

Image 6

Image 7

Installation de socket.io-adapter

Image 8

Image 9

Installation module ent

Image 10

Image 11

and for the last step, we made a connectivity test:

Image 12

Note: If you noticed whenever you must check if there is a module does not exist.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)