nvm-windows: set 'proxy' with incorrect parameter make nvm always crash

My Environment

  • Windows 10

I’m using NVM4W version:

Run nvm version if you don’t know.

I have already…

  • read the README to be aware of npm gotchas & antivirus issues.
  • reviewed the wiki to make sure my issue hasn’t already been resolved.
  • verified I’m using an account with administrative privileges.
  • searched the issues (open and closed) to make sure this isn’t a duplicate.
  • made sure this isn’t a question about how to use NVM for Windows, since gitter is used for questions and comments.

My issue is related to (check only those which apply):

  • settings.txt
  • A standard shell environment (terminal/powershell)
  • A non-standard shell environment (Cmder, Hyper, Cygwin, git)

Actual Behavior

C:\Users\Himself65>nvm version
1.1.7

C:\Users\Himself65>nvm proxy .

C:\Users\Himself65>nvm
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
main.Setup()
        C:/Users/corey/Documents/workspace/nvm-windows/src/nvm.go:685 +0x8ed
main.main()
        C:/Users/corey/Documents/workspace/nvm-windows/src/nvm.go:60 +0x61

I think you didn’t check if it’s the valid parameter when setting.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (3 by maintainers)

Most upvoted comments

@bozzgo13 try nvm install 16.18.1 (without the version part)

I just installed nvm-windows, and my settings.txt looks like this:

root: C:\Users\wagge\AppData\Roaming\nvm
path: C:\Program Files\nodejs

No “proxy” in there, but I get the same error.

image

Is this projet maintained?

same issue with me, no proxy in settings

image

After I update nvm to 1.1.11, it seems works again.

C:\Users\Liu.D.H>nvm version
1.1.11

C:\Users\Liu.D.H>nvm install 20.0.0
Downloading node.js version 20.0.0 (64-bit)...
Extracting node and npm...
Complete
npm v9.6.4 installed successfully.


Installation complete. If you want to use this version, type

nvm use 20.0.0

C:\Users\Liu.D.H>

For those of you having trouble, do as follows (WINDOWS 10)

nvm install latest

go to file explorer and browse to %AppData%, make sure you’re in the Roaming folder

Find the folder titles v##.#.# (in my case v19.7.0)

back into cmd/powershell/whatever

nvm use 19.7.0

do not include the v

node -v

Verify your node version.

@bozzgo13 try nvm install 16.18.1 (without the version part)

You can also use ‘nvm install latest’ if you want to install the latest version of Node.

What I don’t understand is why the panic appears to be looking for files on the developers OneDrive. Is there a way to edit this?

The issue here is . is not a valid proxy. A proxy needs to be a URL. If you’re receiving this error, manually reset the proxy in the settings.txt file (in the local nvm4w installation root).

Hi, for anyone who’s trying to get back nvm working again, removing line with proxy in settings.txt worked for me:

root: C:\Users\USER\AppData\Roaming\nvm
arch: 64
- proxy: -h
originalpath: 
originalversion: 
node_mirror: 
npm_mirror: 

nvm version: 1.1.5

@bozzgo13 try nvm install 16.18.1 (without the version part) thaaannnnkkk youuuuu jesus lol

@randomactions the project is still maintained, but I don’t have a Windows machine to test on at the moment.