node-argon2
node-argon2 copied to clipboard
Build fails on Node 16.4 ARM M1
I note there are new ARM builds but trying yarn add argon2
fails on my system.
Big Sur 11.3 Node v16.4.0
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | darwin | arm64
node-pre-gyp info check checked for "/Volumes/Samsung 850PRO/NEXTJS_Sites/restaurant/node_modules/argon2/lib/binding/napi-v3/argon2.node" (not found)
node-pre-gyp http GET https://github.com/ranisalt/node-argon2/releases/download/v0.28.2/argon2-v0.28.2-napi-v3-darwin-arm64-unknown.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/ranisalt/node-argon2/releases/download/v0.28.2/argon2-v0.28.2-napi-v3-darwin-arm64-unknown.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/ranisalt/node-argon2/releases/download/v0.28.2/argon2-v0.28.2-napi-v3-darwin-arm64-unknown.tar.gz
[...]
Odd, indeed there is no Darwin ARM64 build even though we have it in the pipeline
Meanwhile, try using npm rebuild argon2 --build-from-source
to recompile it. You need a C++ compiler installed.
Indeed, we build for ARM64 and for OS X but not for OS X on ARM64 together. I don't even think it is feasible, as GitHub Actions run on x86 and the run-on-arm64 action does not support OS X. For the time being, you will have to rebuild from sources.
There's an open issue for M1 support on github actions: https://github.com/actions/virtual-environments/issues/2187
It looks like there hasn't been any updates on it since December of last year.
so any updates about arm64 ?
anything?
Anything?
To solve this problem, I downgrade my node version to v14 by using nvm :
nvm install 14
nvm use 14
any news ? Rebuild from source does not work unfortunately.
Still fails on node v16.7.0
No development from Github on supporting M1 for Actions, so no progress on this issue yet :(
The package sharp has an ARM build, it says MacStadium but maybe you can try it out? You can checkout the commit here: https://github.com/lovell/sharp/commit/21d1a7ca620fe667fb7dd463cc2fcc80ffebc2e4
Also seems like MacStadium is supporting open source projects! https://www.macstadium.com/opensource
Thanks for all the hard work @ranisalt! Any update on this?
Any possibility this could accelerate the timeline? Looks very promising and apparently usable today. https://github.com/hkratz/gha-runner-osx-arm64/pull/2
Collection of some other related threads: https://github.com/gitx/gitx/issues/289
Currently node-argon2
is the only dependency holding us back from support for Apple M1 platforms, so please let me know if there's anything we can do to help!
@Slapbox definitely, will keep track of these in order to support ARM64 OS X as soon as possible.
Note on node-gyp fails. Apparently, I've been using my old .npmrc
file from my old non-M1 computer, and it had a node_gyp=[definitely not existing path]
line in it. This was preventing yarn from building the package.
Hope this helps someone!
This still doesn't install on M1 Macs a year later.
I hope that this is given a higher priority. In the meantime I guess I'll use bcrypt.
@Tenpi in theory you should be able to build the package from source on M1 machines. It's really just those of us without M1 machines that are out of luck for now.
This still doesn't install on M1 Macs a year later.
You should be able to install it from source as @Slapbox mentioned. It is a priority to get it working decently on every major platform but this project doesn't really have the resources to do so swiftly :(
M1 chips have made trouble for many projects. It's hardly something node-argon2
is alone in.
Is there anything the users of this project can do to help accelerate the process?
Donate a M1 to me so I can work around that :laughing: but seriously, I applied to MacStadium as per @partyconfetti suggestion, and hopefully the workflow used by sharp can be just copy-pasted.
Compiling arm64 images for Darwin (Mac) is also possible on intel with cross compilation.
Check some of the other projects that does that already, like: https://github.com/lovell/sharp-libvips/blob/main/.github/workflows/build-release.yml
How it is done: https://github.com/lovell/sharp-libvips/pull/74
@ranisalt - Does this get us any closer? https://github.com/actions/runner/pull/1618#issuecomment-1133366112
@ranisalt did you ever hear back about your MacStadium application? Any news on this generally?
I hate to keep bumping this thread, but I also dislike that our installer size is 500mb for macOS users (certainly not saying that's your fault - I am very grateful for your work.) I'm eagerly anticipating the day node-argon2
can have a prebuilt binary for ARM-based macOS devices.
@Slapbox I got an approval from MacStadium a couple of days ago, but I'm on vacation for this week, after that I'll be able to work on it - and it shouldn't be very long since you guys helped a lot already :)
If you prefer, you can open a pull request configuring it and I will set up the token when needed.
If you can afford to upgrade, using Node 18.1.0 fixed the issue for me. Rebuilding from source wasn't doing the trick.
Any updates @ranisalt? Not to rush you of course; I super appreciate that you even shared this project to begin with! A few macOS users are dismayed at the giant size of the dual-architecture installer we're distributing in the meanwhile which got this back on my radar.
If I had any experience with MacStadium I'd be happy to help with a PR, but sadly I haven't got a clue.
@Slapbox I'm working on that now on the macos-m1 branch. MacStadium has answered me ~~quite a while ago, but I was super busy changing jobs~~ and now I'm setting up the runner to test, build & deploy the M1 (and possibly M2) versions.
Here we go! Please help me test v0.29.0
Thank you so much for your outstanding work @ranisalt! I finally got a chance to give this a try and it's looking great!
Macbook Pro M2 2022 user here - still getting following error:
'node_modules/argon2/lib/binding/napi-v3/argon2.node' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))
I tried it with using v0.29.0 but sadly it didn't work, even with v0.29.1
Fixed this by changing my architecture with following commands (using nvm):
necmi@MBP-von-Necmi gc-backend % arch -x86_64 zsh
necmi@MBP-von-Necmi gc-backend % nvm uninstall v16.14.2
Uninstalled node v16.14.2
necmi@MBP-von-Necmi gc-backend % nvm install v16.14.2
It should install (depending on your system) https://nodejs.org/dist/v18.9.0/node-v18.9.0-darwin-x64.tar.xz
instead of https://nodejs.org/dist/v18.9.0/node-v18.9.0-darwin-arm64.tar.xz
@necm1 this is an upstream issue, it is @mapbox/node-pre-gyp that decides what prebuilt to install. Can you open an issue there and link back so we can track it?