我正在尝试使用Node.js和Box2dWeb引擎制作服务器。但是试图“导入”“box2d.js”会引发一个随机错误,这似乎与我正在做的事情无关。这是导致错误的代码:
var Box2D = require('./box2d.js');
这是错误:
console.js:55
this._stdout.write(util.format.apply(this, arguments) + '\n');
^
TypeError: Cannot read property 'write' of undefined
at Console.log (console.js:55:15)
at TCPServer.<anonymous> (C:\Users\conne_000\Documents\ntm2\NTM2Server2\main
.js:16:10)
at TCPServer.emit (events.js:129:20)
at Server.<anonymous> (C:\Users\conne_000\Documents\ntm2\NTM2Server2\classes\servers\tcp_server.js:20:8)
at Server.emit (events.js:104:17)
at net.js:1171:12
at process._tickCallback (node.js:355:11)
at Function.Module.runMain (module.js:503:11)
at startup (node.js:129:16)
at node.js:814:3
Press any key to continue . . .
我不知道该怎么做。非常感谢任何帮助!