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

Fix nvm node upgrades | Update regex node.js version matching #956

Closed
wants to merge 1 commit into from

Conversation

moekhalil
Copy link

Fixes issues people are having with upgrading node. (e.g fixes: (#955) (#942) )

Node.js has added support for Windows ARM64 MSI files, which broke the regex version matching in nvm.go. It was only looking for msi files that had an "-x" in it (due to x86 and x64) and would use that -x as a reference point to retrieve the version number.

Went ahead and updated the regex so it can match x86, x64, and arm64 MSI's and now it can compare the versions properly.
This resolves the panic: runtime error: index out of range [3] with length 3 error. (which was happening because it would try to compare [19,9,0] with [19,9,0-arm,msi]

Node.js has now added support for Windows ARM64, which broke the regex version match in nvm.go, as it was only looking for msi files that had an "-x" in it (for x86 and x64).

Went ahead and updated the regex to match x86, x64, and amd64 arm and now it can compare the versions properly and the `index of out range error` won't show up. (It was happening because it would try to compare `[19,9,0] with [19,9,0-arm,msi]`
@coreybutler
Copy link
Owner

Thank you for this. I won't be accepting it though, because I already made these changes locally.... they just haven't been pushed yet :-)

@hd321kbps
Copy link

Thank you for this. I won't be accepting it though, because I already made these changes locally.... they just haven't been pushed yet :-)

When can we expect a new version? with a fix?

@moekhalil
Copy link
Author

moekhalil commented Apr 11, 2023

Thank you for this. I won't be accepting it though, because I already made these changes locally.... they just haven't been pushed yet :-)

When can we expect a new version? with a fix?

Hopefully @coreybutler was talking about something soon, as this is an urgent fix, and the patch here can be easily rebased/dealt with if it's merge conflicts he's worried about.

@coreybutler Do you think it will be in the next 24 hours?

EDIT: NVM the fix is in.

I was looking for a pull request but it seems it was just committed to master directly. @coreybutler 👍🏼

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.

3 participants