运行socket.io程序时出错

发布于 2024-10-28 20:15:05 字数 946 浏览 1 评论 0原文

我下载了这个程序

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)

I downloaded this program

https://github.com/DanBUK/bejesus-socket-io-demo

but when i do

node socket-demo.js

It gives me this error

 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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月亮是我掰弯的 2024-11-04 20:15:05

应用程序需要环境变量 app_portapp_host。尝试

$ export app_port=8000
$ export app_host=localhost
$ node socket-demo.js

The application expects the environment variables app_port and app_host. Try

$ export app_port=8000
$ export app_host=localhost
$ node socket-demo.js
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文