io.on('connection', socket =>{ ^
TypeError: io.on is not a function at Object. (D:\shalini course\projects\chat app\nodeserver\nodeapp.js:7:4) at Module._compile (node:internal/modules/cjs/loader:1218:14) at Module._extensions..js (node:internal/modules/cjs/loader:1272:10) at Module.load (node:internal/modules/cjs/loader:1081:32) at Module._load (node:internal/modules/cjs/loader:922:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47
it shows this error when I run a cmd - node nodeapp.js please do reply If any idea how to fix it?
enter image description here I tried running an application of socket.io on 5000 port using node.js but it's not working.