A
A
Alexander272021-03-31 17:30:51
Node.js
Alexander27, 2021-03-31 17:30:51

How to fix errors in node?

Node code does not compile. Where is the mistake? listen is not a function and the issue is with modules.

606487468b988155561498.png
60648755c60b5216227564.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SagePtr, 2021-03-31
@Alexandr27

The socket.io module has been returning a constructor for a long time, so listen does not need to be used:
var io = require('socket.io')(server);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question