Can't compile on MacOS M1

Hi guys. Did you try to compile the rescript project on the apple silicon processor? I’ve just bought one and I’m trying to build the rescript-project (based on the nextjs template but it fails with the folowing error:

gentype was not installed correctly

Any ideas how to solve it?

ReScript itself works just fine on M1 via Rosetta. I wonder if there’s something specific to gentype that is failing :thinking:

Can you please post the whole log leading up to the error message? On pastebin or something like that?

Hi again, I managed to solve it by downgrading npm to version 6. I really don’t know why it worked :slight_smile:

I don’t own an M1 myself, but isn’t there some procedure of telling macos to use rosetta on a certain binary? may it be that you need to run gentype separately first to cause the rosetta dialog to trigger?

Node v15 supports the M1 natively (or that’s the version homebrew for M1 installed, anyway, and it’s compiled as native arm). Rosetta is automatic, there’s no need to tell the OS to use it (other than it not being installed by default).

I just tried that repo and it failed at first, but then I remembered I have ignore-scripts=true in my .npmrc. That lead me to confirm the default gentype executable just prints the error message:

Gentype depends on the postinstall script running to move the correct platform file into place. A failure there is the likely cause of this issue, not specifically due to running on an M1.

This is also occurred in my MacBook Pro 2019, it it not a M1 problem.

I saw @luski said solved it by downgrading npm to version 6.

I’m not use ReScript with product use,I’m Just writing a intro article for how to use rescript-react in chinese, so I’m gonna wait rescript team to fixed it.

what are your error logs