setup socket.io in node.js code example Example 1: install socket.io npm i socket.io Example 2: socket io node js npm install socket.io