RobLoach / node-raylib

Node.js bindings for Raylib
https://robloach.github.io/node-raylib/
Other
233 stars 20 forks source link

Quick start instructions don't work for Mac M1 #169

Closed davjhan closed 1 year ago

davjhan commented 1 year ago

Hi! I'm trying to get the README instructions to run on my M1 macbook, but I'm getting the following error:

error: Cannot find module "../../build/Release/node-raylib.node" from "/Users/{my projects path}/raylib-hello-world/node_modules/raylib/src/generated/node-raylib.js"

And in Releases, I don't see a fitting build for M1 macs. In fact, when I run node node_modules/raylib/tools/generate.js, I see:

Checking for https://github.com/RobLoach/node-raylib/releases/download/vundefined/node-raylib-darwin-arm64.node
Status: 404
Not found. Building.

According to this other issue, it should 'just work' for Mac M1. Are there further instructions that I have to follow to get this running?

Thanks.

davjhan commented 1 year ago

@konsumer

davjhan commented 1 year ago

NVM! Sorry, this must have been because I was using bun to install. But cleaning my node_modules and reinstalling it via npm install worked as expected.

twuky commented 1 year ago

M1 is the only platform we don't have CI able to build automatically right now. there were a few versions where @konsumer built it and uploaded manually to the Releases, but we don't have it for 4.5 yet.

also for the bun runtime- its been a while since I tested but even if you got it installed I remember bun having some issues. It seemed to treat floating points wrong or something to that effect, and I couldn't render anything. If that's working now I'd be interested to hear how it performs!

konsumer commented 1 year ago

I can compile a ready-made for M1, but also if you have build tools (c compiler and cmake) you should also be able to automatically compile when you npm i.

Basically, we add those as a convenience, so users don't have to recompile the native module, but "normal" use would be that it compiles the source for the current platform.

Here is what I see when I npm i, on my M1:

Checking for https://github.com/RobLoach/node-raylib/releases/download/v0.12.0/node-raylib-4.2-darwin-universal.node
Status: 404
Not found. Building.

Then it builds using cmake.

davjhan commented 1 year ago

Sorry @twuky, to clarify, I wasn't able to get it working using bun, but I was able to get it working using npm.