Closed raulrpearson closed 3 years ago
Thanks, Raúl! Can you explain how this works?
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.
Fixes #138.