I
I
Ilya Beloborodov2016-05-02 14:25:58
Node.js
Ilya Beloborodov, 2016-05-02 14:25:58

socket.io how to install?

npm install socket.io
var io = require('socket.io');
Error: Cannot find module 'socket.io'
Why? I did everything as in the dock?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya Beloborodov, 2016-05-02
@kowap

For those who are looking for a solution.
In package.json

"dependencies": {
........
"socket.io-client": "file:socket.io",
"socket.io": "latest"
}

then
npm install

T
Timur Shemsedinov, 2016-05-02
@MarcusAurelius

Socket.io is not needed for anything. Check out this websocket example: https://github.com/HowProgrammingWorks/WebsocketChat

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question