Deploy coco into my Mac machine failed

Hi,
I am running codecombat source code in my Mac machine, but I see the error that document is not defined. How to fix it?