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

nvm install lts panic #1064

Closed
bouvdog opened this issue Nov 22, 2023 · 1 comment
Closed

nvm install lts panic #1064

bouvdog opened this issue Nov 22, 2023 · 1 comment

Comments

@bouvdog
Copy link

bouvdog commented Nov 22, 2023

What happened?

nvm install lts returns ''panic: runtime error: index out of range[0] with length 0"
nvm list returns "no installations recognized"

What did you expect to happen?

First command, to install the latest version of node
Second command, to list node versions

Version

1.1.11 or newer (Default)

Which version of Windows?

Windows 11+

Which locale?

English (Default)

Which shell are you running NVM4W in?

PowerShell

User Permissions?

Administrative Privileges, Elevated

Is Developer Mode enabled?

No (Default)

Relevant log/console output

PS C:\WINDOWS\system32> nvm debug
Running NVM for Windows with administrator privileges.

Administrator: Windows PowerShell
NVM4W Version:      1.1.11
NVM4W Path:         C:\Users\Kevin\AppData\Roaming\nvm\nvm.exe
NVM4W Settings:     C:\Users\Kevin\AppData\Roaming\nvm\settings.txt
NVM_HOME:           C:\Users\Kevin\AppData\Roaming\nvm
NVM_SYMLINK:        C:\Program Files\nodejs
Node Installations: C:\Users\Kevin\AppData\Roaming\nvm

Active Node.js Version: none
(run "nvm use <version>" to activate a version)

No problems detected.

Find help at https://github.com/coreybutler/nvm-windows/wiki/Common-Issues
PS C:\WINDOWS\system32> nvm list

No installations recognized.
PS C:\WINDOWS\system32> nvm install lts
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
main.getLTS(...)
        C:/Users/corey/OneDrive/Documents/workspace/libraries/oss/coreybutler/nvm-windows/src/nvm.go:1141
main.getVersion({0xa0140b0, 0x3}, {0x10b6b0d, 0x2}, {0x0, 0x0, 0x0})
        C:/Users/corey/OneDrive/Documents/workspace/libraries/oss/coreybutler/nvm-windows/src/nvm.go:225 +0x73d
main.install({0xa0140b0, 0x3}, {0x10b6b0d, 0x2})
        C:/Users/corey/OneDrive/Documents/workspace/libraries/oss/coreybutler/nvm-windows/src/nvm.go:290 +0x255
main.main()
        C:/Users/corey/OneDrive/Documents/workspace/libraries/oss/coreybutler/nvm-windows/src/nvm.go:94 +0xaf7
PS C:\WINDOWS\system32>

Debug Output

PS C:\WINDOWS\system32> nvm debug
Running NVM for Windows with administrator privileges.

Administrator: Windows PowerShell
NVM4W Version:      1.1.11
NVM4W Path:         C:\Users\Kevin\AppData\Roaming\nvm\nvm.exe
NVM4W Settings:     C:\Users\Kevin\AppData\Roaming\nvm\settings.txt
NVM_HOME:           C:\Users\Kevin\AppData\Roaming\nvm
NVM_SYMLINK:        C:\Program Files\nodejs
Node Installations: C:\Users\Kevin\AppData\Roaming\nvm

Active Node.js Version: none
(run "nvm use <version>" to activate a version)

No problems detected.

Find help at https://github.com/coreybutler/nvm-windows/wiki/Common-Issues

Anything else?

OS Name Microsoft Windows 11 Pro Insider Preview
Version 10.0.23585 Build 23585

@coreybutler
Copy link
Owner

The remote JSON file providing the list of versions is only partially returning, so NVM4W is getting an incomplete response from the Node servers (i.e. invalid JSON). I'm adding special error handling for this so users will know what is going on... but the fix is basically to wait for the server to return a proper response. I will release this as v1.1.12 sometime today. In the meantime, I encourage users to wait a few minutes and retry. Alternatively, download the specific version (20.9.0 as of this writing). This bypasses the version lookup process for the lts alias.

This behavior is happening sporadically at the moment. Some changes are happening in the Node GitHub repo, so it is likely just a matter of time before the web server caches are updated.

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

2 participants