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

Add support for new Node.js builds for Apple silicon #664

Merged
merged 4 commits into from
Apr 19, 2021

Conversation

shadowspawn
Copy link
Collaborator

@shadowspawn shadowspawn commented Apr 17, 2021

Pull Request

Problem

Node.js is available natively on Apple silicon from v16, but not before.

n is currently switching the architecture from arm64 to x64 on Darwin to allow installing older versions to run using Rosetta.

Related: #641

Solution

On Macs with Apple silicon...

  • version resolution and remote listing include both the x64 and arm64 targets
  • downloads for Node.js 16 and higher use arm64
  • downloads for Node.js below 16 use x64
  • specifying an explicit architecture using --arch shows and downloads only the matching architecture

I considered switching architecture if arm64 download missing, but decided simpler code and story switching based on the Node.js version.

ChangeLog

  • on Macs with Apple silicon, use native arm64 for Node.js versions for version 16 and higher

@shadowspawn
Copy link
Collaborator Author

This PR assumes index.tab lists the arm64 as an available download, which isn't happening quite yet.

See nodejs/nodejs-dist-indexer#14

@shadowspawn shadowspawn marked this pull request as ready for review April 19, 2021 08:21
@shadowspawn shadowspawn merged commit edc9d04 into develop Apr 19, 2021
@shadowspawn shadowspawn deleted the feature/apple-silicon branch April 19, 2021 08:37
@shadowspawn shadowspawn mentioned this pull request Aug 10, 2021
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

Successfully merging this pull request may close these issues.

1 participant