0

I have windows 10 machine and when I try to run my script it's throw error Cannot find module 'socket.io'

server.listen(8089);
// use socket.io
var io = require('socket.io').listen(server);
Vipin Sharma
  • 421
  • 5
  • 24

1 Answers1

0

You'll want to use npm install (from your command prompt) to ensure the socket.io package is installed before use.

npm install --save socket.io

The --save flag will add the given dependency to your application's package.json for easier installation in the future

Sean3z
  • 3,745
  • 6
  • 26
  • 33