canvasengine Tiled_server错误:ENOENT,打开' ./ map.json'

时间:2015-07-11 08:06:04

标签: node.js canvasengine

这是我的问题: 我尝试启动Canvasengine示例服务器,我收到此错误。

root@vps185158:/# node /var/www/canvas/canvasengine/examples/tiled_server/server/server.js
   info  - socket.io started
   debug - client authorized
   info  - handshake authorized ogjRNMePBqcD_ZIkFVFK
   debug - setting request GET /socket.io/1/websocket/ogjRNMePBqcD_ZIkFVFK
   debug - set heartbeat interval for client ogjRNMePBqcD_ZIkFVFK
   debug - client authorized for
   debug - websocket writing 1::
/node_modules/canvasengine/core/engine-common.js:373
                        if (err) throw err;
                                       ^
Error: ENOENT, open './map.json'
    at Error (native)

map.json就在那里,但是nodejs找不到该文件。

服务器有Debian 7,nodejs,Socket.io和CanvasEngine 1.3.0

1 个答案:

答案 0 :(得分:0)

查看代码,您应该将map.json复制到您的工作目录(似乎是/,因此我不一定会建议这样做)或从相应的目录启动服务器:

$ cd /var/www/canvas/canvasengine/examples/tiled_server/server/
$ node server

(虽然这可能需要设置$NODE_PATH