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