Cannot find module 'socket.io' windows 10

五迷三道 提交于 2021-01-29 17:22:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!