I'm trying to run the Pocket-Island game by Wooga and have installed all prerequisites listed at that page:
gem install rake
npm install -g less
npm install -g jslint
...
And then build the program successfully by running
rake all
And have now a new build
directory:
app.js css images index.html ipad.html templates version
The app.js is 400k and looks like a minimized JavaScript file.
Then I try to run it with node
:
#node ./app.js
/home/afarber/src/Pocket-Island/build/app.js:1
window.wooga.cas
^
ReferenceError: window is not defined
at Object.<anonymous> (/home/afarber/src/Pocket-Island/build/app.js:1:63)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)
at Function._load (module.js:311:12)
at Array.0 (module.js:484:10)
at EventEmitter._tickCallback (node.js:190:38)
Being a complete node.js newbie, I suspect I'm missing something very obvious. Does anybody have an advice for me please?
I've looked into app.js and there is no window.wooga.cas
, but there are several following variables:
window.wooga.castle.levels = .....
window.wooga.castle.entityDefinitions = .....
window.wooga.castle.version = "38da43a566503f3043576dafaf77f89363017397" ;
window.wooga.castle.tutorial = ....
So I think app.js
is ok, but I must install it somewhere or maybe tell it where to find standard libraries? (I've installed node.js under /usr/local/
)
I'm using a CentOS 6.2 and I'm actually an experienced Linux user.
UPDATE: More info (not sure if helpful):
# npm root
/home/afarber/src/Pocket-Island/build/node_modules
# npm --version
1.1.24
# node --version
v0.6.19
node is used for building only, not for running the game. It looks like the build itself worked fine so far. The app.js
fie is to be loaded by index.html
in a web browser.