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 case for darwin arm64 #148

Conversation

raulrpearson
Copy link
Contributor

Fixes #138.

@jorgebucaran
Copy link
Owner

Thanks, Raúl! Can you explain how this works?

@raulrpearson
Copy link
Contributor Author

raulrpearson commented Mar 17, 2021

Sure. Without this fix, on my M1 I get the following:

❯ nvm install lts/erbium
Installing Node v12.21.0 lts/erbium
Fetching https://nodejs.org/dist/v12.21.0/node-v12.21.0-darwin-arm64.tar.gz
nvm: Invalid mirror or host unavailable: "https://nodejs.org/dist/v12.21.0/node-v12.21.0-darwin-arm64.tar.gz"

After this fix, I get:

❯ nvm install lts/erbium
Installing Node v12.21.0 lts/erbium
Fetching https://nodejs.org/dist/v12.21.0/node-v12.21.0-darwin-x64.tar.gz
Now using Node v12.21.0 (npm 6.14.11) ~/.local/share/nvm/v12.21.0/bin/node

Basically, this fix is telling the function to use the darwin-x64 binary instead of the darwin-arm64, which doesn't yet exist. I added the os check following @jamesb93's concerns about not messing up the URL generation for users on Linux.

I'm testing by overwriting the nvm.fish file in my ~/.config/fish/functions folder. I tried installing/uninstalling a couple of Node.js versions. Let me know if you need any other explanation or assurance.

I'm also happy to change the code if you want to suggest a different way to solve this.

@jorgebucaran jorgebucaran added the enhancement New feature or fix label Mar 17, 2021
@jorgebucaran jorgebucaran merged commit 621c1f4 into jorgebucaran:main Mar 18, 2021
@raulrpearson raulrpearson deleted the apple-silicon-download-url-generation branch March 18, 2021 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apple Silicon and URL string generation
2 participants