Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple M1 #51

Open
rubyte-s opened this issue Dec 15, 2020 · 13 comments
Open

Apple M1 #51

rubyte-s opened this issue Dec 15, 2020 · 13 comments

Comments

@rubyte-s
Copy link

Error: No native build was found for platform=darwin arch=arm64 runtime=electron abi=85 uv=1 armv=8 libc=glibc node=12.18.3 electron=11.0.3
loaded from: /Users/shaun/.vscode-exploration/extensions/intersystems.language-server-1.0.5/server/node_modules/ref-napi

at Function.load.path (/Users/shaun/.vscode-exploration/extensions/intersystems.language-server-1.0.5/server/node_modules/node-gyp-build/index.js:59:9)
at load (/Users/shaun/.vscode-exploration/extensions/intersystems.language-server-1.0.5/server/node_modules/node-gyp-build/index.js:21:30)
at Object.<anonymous> (/Users/shaun/.vscode-exploration/extensions/intersystems.language-server-1.0.5/server/node_modules/ref-napi/lib/ref.js:8:53)
at Module._compile (internal/modules/cjs/loader.js:1152:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10)
at Module.load (internal/modules/cjs/loader.js:992:32)
at Module._load (internal/modules/cjs/loader.js:885:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12694)
at Module.require (internal/modules/cjs/loader.js:1032:19)
at require (internal/modules/cjs/helpers.js:72:18)
@detongz
Copy link

detongz commented Apr 7, 2021

+1

@cunchi
Copy link

cunchi commented Jun 17, 2021

How is the progress of this issue🤔️

@ayush2209
Copy link

Did you got any solution for this issue.
I am alos facing this issue on M1 Mac.

@TimothyJones
Copy link

How are you triggering this issue? I'm on an M1, and on npm install node-gyp-build triggers and compiles from source happily.

@msynk
Copy link

msynk commented Oct 21, 2021

How are you triggering this issue? I'm on an M1, and on npm install node-gyp-build triggers and compiles from source happily.

the error will be raised at runtime and not at the build/compile time.

@TimothyJones
Copy link

How are you triggering the error? I am on M1 and have no trouble using this package.

The build triggers on install, which is where your error is coming from.

@amccloud
Copy link

amccloud commented Dec 11, 2021

I'm also seeing the same error at runtime on a M1. Install/build works fine and the error happens only during runtime when ffi-napi is imported. If I force my process to run under Rosetta everything works as expected. cc: @msynk

@TimothyJones I'm not entirely sure how the prebuild system works, but it looks like arm64 for darwin does not exist for ref-napi@3.0.3. Should i expect it to build on my mahcine?

ls -la node_modules/ref-napi/prebuilds/ 
total 0
drwxr-xr-x   7 andrew  staff  224 Dec 11 10:16 .
drwxr-xr-x  19 andrew  staff  608 Dec 11 10:16 ..
drwxr-xr-x   4 andrew  staff  128 Dec 11 10:16 darwin-x64
drwxr-xr-x   4 andrew  staff  128 Dec 11 10:16 linux-arm64
drwxr-xr-x   4 andrew  staff  128 Dec 11 10:16 linux-x64
drwxr-xr-x   4 andrew  staff  128 Dec 11 10:16 win32-ia32
drwxr-xr-x   4 andrew  staff  128 Dec 11 10:16 win32-x64  
Error: No native build was found for platform=darwin arch=arm64 runtime=electron abi=85 uv=1 armv=8 libc=glibc node=12.18.3 electron=11.5.0
    loaded from: /Applications/Example.app/Contents/Resources/app-arm64.asar/node_modules/ref-napi

@amccloud
Copy link

It looks like installing packages with npm_config_build_from_source=true in the environment seems to bypass prebuilds and works for me

@TC-mSundaram
Copy link

I'm seeing this same issue, but npm_config_build_from_source=true npm install doesn't resolve it. Is there anything else that I could try?

@TC-mSundaram
Copy link

This is what I'm getting at runtime:

Uncaught Exception:
Error: dlopen(/Volumes/ElectronApp-arm64/ElectronApp.app/Contents/Resources/app.asar.unpacked/node_modules/ref-napi/build/Release/binding.node, 0x0001): tried: '/Volumes/ElectronApp-arm64/ElectronApp.app/Contents/Resources/app.asar.unpacked/node_modules/ref-napi/build/Release/binding.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/binding.node' (no such file), '/usr/lib/binding.node' (no such file)
at process.func [as dlopen] (node:electron/js2c/asar_bundle:5:1800)
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1199:18)
at Object.func [as .node] (node:electron/js2c/asar_bundle:5:2027)
at Module.load (node:internal/modules/cjs/loader:988:32)
at Module._load (node:internal/modules/cjs/loader:829:12)
at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
at Module.require (node:internal/modules/cjs/loader:1012:19)
at require (node:internal/modules/cjs/helpers:9418)
at load (/Volumes/ElectronApp-arm64/ElectronApp.app/Contents/Resources/app.asar/node_modules/node-gyp-build/index.js:21:10)
at Object.<anonymous> (/Volumes/

@TC-mSundaram
Copy link

Update: I was able to resolve the issue. I am using electron-builder and needed to use buildDependenciesFromSource in the config.

@kabaehr
Copy link

kabaehr commented May 11, 2022

Maybe this helps someone, not sure. I only had this with Node < version 17. With version 17 I have other issues I am looking into right now, though

@cuijindong
Copy link

How is the progress of this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants