我下载了这个程序
https://github.com/DanBUK/bejesus-socket-io-demo
但是当我做的时候
node socket-demo.js
它给了我这个错误
node socket-demo.js
node.js:50
throw e; // process.nextTick error, or 'error' event on first tick
^
WideCharToMultiByte: The data area passed to a system call is too small.
TypeError: Bad argument
at Object.stat (fs.js:328:11)
at Server.<anonymous> (net.js:1093:19)
at Server.listen (/usr/local/lib/node/.npm/express/1.0.7/package/lib/express
/server.js:101:35)
at Object.<anonymous> (/home/Administrator/socket-io-demo/socket-demo.js:15:
5)
at Module._compile (node.js:329:23)
at Object..js (node.js:337:12)
at Module.load (node.js:260:25)
at Array.<anonymous> (node.js:351:24)
at EventEmitter._tickCallback (node.js:42:22)
答案 0 :(得分:1)
应用程序需要环境变量app_port
和app_host
。尝试
$ export app_port=8000
$ export app_host=localhost
$ node socket-demo.js