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

After connection failure, panic #948

Closed
qiulaidongfeng opened this issue Mar 18, 2023 · 4 comments · Fixed by #949
Closed

After connection failure, panic #948

qiulaidongfeng opened this issue Mar 18, 2023 · 4 comments · Fixed by #949
Labels
needs better error message NVM4W would benefit from a better error/failure message.

Comments

@qiulaidongfeng
Copy link
Contributor

qiulaidongfeng commented Mar 18, 2023

How To Reproduce:
nvm install 10.22.0,Downloading npm version 6.14.6 timeout

Expected Behavior:
Tell me it's timed out

Actual behavior:
Downloading node.js version 10.22.0 (64-bit)...
Complete
Creating D:\nodejs\temp

Downloading npm version 6.14.6... Error while downloading https://github.com/npm/cli/archive/v6.14.6.zip - Get "https://github.com/npm/cli/archive/v6.14.6.zip": read tcp 192.168.1.252:53924->140.82.114.4:443: wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x20 pc=0xc6b53d]

goroutine 1 [running]:
nvm/web.Download({0x120ac030, 0x2e}, {0x1200e540, 0x1e}, {0x122e6d90, 0x6})
C:/Users/corey/OneDrive/Documents/workspace/libraries/oss/coreybutler/nvm-windows/src/web/web.go:90 +0x44d
nvm/web.GetNpm({0x12018da1, 0x9}, {0x122e6d90, 0x6})
C:/Users/corey/OneDrive/Documents/workspace/libraries/oss/coreybutler/nvm-windows/src/web/web.go:257 +0x39d
main.install({0x120180e8, 0x7}, {0xcd9d26, 0x2})
C:/Users/corey/OneDrive/Documents/workspace/libraries/oss/coreybutler/nvm-windows/src/nvm.go:364 +0x9d9
main.main()
C:/Users/corey/OneDrive/Documents/workspace/libraries/oss/coreybutler/nvm-windows/src/nvm.go:87 +0xaea

@coreybutler
Copy link
Owner

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

Either the remote server was down (which has happened a few times lately) or there was a problem with your connection. I just tried this and the download succeeded.

image

@qiulaidongfeng
Copy link
Contributor Author

I also downloaded successfully later. I only felt that there was a bug when I saw the panic and stack information

@coreybutler
Copy link
Owner

Understandable. NVM4W could use a better error message than the go stack trace.

@coreybutler coreybutler added the needs better error message NVM4W would benefit from a better error/failure message. label Mar 19, 2023
@qiulaidongfeng
Copy link
Contributor Author

I submitted a PR that should avoid panic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs better error message NVM4W would benefit from a better error/failure message.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants