问题
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);
回答1:
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
来源:https://stackoverflow.com/questions/36716823/cannot-find-module-socket-io-windows-10