很简单的一个小程序,用到socket.io
git: https://github.com/fwjyttbtx/ChatApp
希望能指出问题
没办法连接啊,我输入用户名点击GO的出现如下错误: info - handshake authorized 5YfjQ5sr1djNSYkJU5Mv
/Users/pro/Desktop/ChatApp-master/node_modules/socket.io/lib/transports/websocket.js:33 else transport = new protocolVersions[‘default’](mng, data, req); ^ TypeError: undefined is not a function at new WebSocket (/Users/pro/Desktop/ChatApp-master/node_modules/socket.io/lib/transports/websocket.js:33:20) at Manager.handleClient (/Users/pro/Desktop/ChatApp-master/node_modules/socket.io/lib/manager.js:662:19) at Manager.handleUpgrade (/Users/pro/Desktop/ChatApp-master/node_modules/socket.io/lib/manager.js:618:8) at Server.<anonymous> (/Users/pro/Desktop/ChatApp-master/node_modules/socket.io/lib/manager.js:123:10) at Server.EventEmitter.emit (events.js:106:17) at Socket.socket.ondata (http.js:1986:14) at TCP.onread (net.js:525:27)
请楼主帮忙查看啊?
请问你的系统是?这个是跑在win7下的 我在公司写的,回家后clone下来npm install
之后没有问题呀。看意思是找不到protocolVersions
的定义的样子,能把你的环境告诉我么,我看能复现不