An object is not a function error occurred in socket.io’s XMLHttpRequest when a chat room application was deployed.

  node.js, question

A chat room application of nodejs plus express plus jade downloaded from the Internet,
Run after deployment, prompting object is not a function error, as shown in the following figure:
图片描述

The nodejs version is as follows:
图片描述

That’s because of the version problem. The most likely reason is that the source code you downloaded uses socket.io below version 0.9. The socket. IO above version 1.0 has changed greatly and is incompatible.

It is recommended that you enter when installingnpm install socket.io@0.9