I think that you have executed the command npm install socket.io
in a different location and your files are in different directory..
So either run the command in the same directory which have your files or either mention the path where you have currently installed socket.io in your PATH variable.