geckosio / phaser-on-nodejs

Allows you to run Phaser 3 game (including Phaser's physics engines) on Node.js
MIT License
102 stars 11 forks source link

Fails to install #16

Closed hpx7 closed 2 years ago

hpx7 commented 2 years ago

I get the following error when I try to run npm i @geckos.io/phaser-on-nodejs:

npm ERR! Package pangocairo was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `pangocairo.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! No package 'pangocairo' found
npm ERR! gyp: Call to 'pkg-config pangocairo --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp

...

npm ERR! gyp ERR! System Darwin 21.4.0
npm ERR! gyp ERR! command "~/.nvm/versions/node/v17.3.0/bin/node" 
npm ERR! gyp ERR! node -v v17.3.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
hpx7 commented 2 years ago

It appears to be an issue with installing canvas. Might have something to do with the fact that I'm using an M1 mac

yandeu commented 2 years ago

It appears to be an issue with installing canvas.

Yes it looks like that: https://github.com/Automattic/node-canvas#compiling

Maybe try this package instead: https://github.com/yandeu/arcade-physics

hpx7 commented 2 years ago

Cool I was able to get arcade-physics working (in case you're curious: https://github.com/hpx7/hathora-phaser-demo)

yandeu commented 2 years ago

Nice! And arcade-physics is also much faster than phaser-on-nodejs.