Evelios / Evelios.github.io

Evelios Website and Blog
0 stars 0 forks source link

Using Fable with Mac M1 Chip #10

Open Evelios opened 9 months ago

Evelios commented 9 months ago

When running on the Mac M1 Chip this program fails to compile because of the change in architecture from x86_64 to arm64.

child proccess errored: Failed to load /usr/local/share/dotnet/shared/Microsoft.NETCore.App/2.1.30/libhostpolicy.dylib, error: dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/2.1.30/libhostpolicy.dylib, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/2.1.30/libhostpolicy.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/2.1.30/libhostpolicy.dylib' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/2.1.30/libhostpolicy.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
An error occurred while loading required library libhostpolicy.dylib from [/usr/local/share/dotnet/shared/Microsoft.NETCore.App/2.1.30]
Evelios commented 9 months ago

From this SO post about running the front end application dart I got this solution https://stackoverflow.com/questions/71882029/mach-o-file-but-is-an-incompatible-architecture-have-arm64-need-x86-64-i

Running on M1 mac, these two commands solved my problem.

$ arch -arm64 brew install llvm
$ sudo gem install ffi
Evelios commented 9 months ago

I was able to get the Arm64 version installed on my mac. I had to fully uninstall the x64 version and install just the Arm64 architecture dotnet application. Github issue link: https://github.com/dotnet/sdk/issues/22380 Dotnet download link: https://dotnet.microsoft.com/en-us/download/dotnet

From there I was hitting another issue of the node installation I have not being arm64 as well

Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64)
Evelios commented 9 months ago

This issue also pertains to the installed node libraries as well. Node and associated libraries all need to be installed with the arm64 architecture as well.