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

Detect arm64 for M1 #683

Closed
alexpts opened this issue Aug 10, 2021 · 6 comments
Closed

Detect arm64 for M1 #683

alexpts opened this issue Aug 10, 2021 · 6 comments

Comments

@alexpts
Copy link

alexpts commented Aug 10, 2021

n use x86_64 arch for M1 macos

$n 12
$file /Users/alex/.n/bin/node
/Users/alex/.n/bin/node: Mach-O 64-bit executable **x86_64**

Homebrew use arm64 arch for M1 macos

$brew install node@12
$file /opt/homebrew/Cellar/node@12/12.22.4/bin/node
/opt/homebrew/Cellar/node@12/12.22.4/bin/node: Mach-O 64-bit executable **arm64**

I think n must detect arch and install arm64 version for M1 CPU

Homebrew formula - https://formulae.brew.sh/api/formula/node@12.json

@shadowspawn
Copy link
Collaborator

n does detect and download arm64 for Node.js v16 on M1 Macs.

n uses the pre-built binaries from Node.js downloads. There is not an arm64 build for node v12 (or v14):

Homebrew have their own bottle (binary package) support for Apple Silicon for node@12 and node@14:

Related: #641 #664

@shadowspawn
Copy link
Collaborator

An answer was provided, and no further activity in a month. Closing this as resolved.

Feel free to open a new issue if it comes up again, with new information and renewed interest.

@L-U-C-K-Y
Copy link

L-U-C-K-Y commented Dec 3, 2021

Hi @shadowspawn, it seems that there are now arm64 versions for node 12, but n does not seem to be able to install them.

When I try to install them, it falls back to v17.

@shadowspawn
Copy link
Collaborator

@L-U-C-K-Y
For Mac, it is the darwin versions that are relevant. There are arm64 versions for v16 but not earlier versions of Node.js.

node-v16.13.1-darwin-arm64.tar.gz                  01-Dec-2021 11:33            28506601
node-v16.13.1-darwin-arm64.tar.xz                  01-Dec-2021 11:33            18427632
node-v16.13.1-darwin-x64.tar.gz                    01-Dec-2021 12:14            29938975
node-v16.13.1-darwin-x64.tar.xz                    01-Dec-2021 12:15            20056120

@L-U-C-K-Y
Copy link

@shadowspawn thanks! Learned something new 😄

@jpike88
Copy link

jpike88 commented Jan 19, 2022

@shadowspawn I think it's worth displaying a warning that this version of node will be run as x64 under rosetta emulation, as there are bugs in some sources that are being compiled and run (e.g. lovell/sharp#3048)

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

4 participants