coreybutler/nvm-windows

[Issue]: error when running "nvm install latest in windows"

yogiprasetio opened this issue · 6 comments

What happened?

Hello, i'm have a trouble when i running "nvm install latest" in my command..

C:\Users\ ***>nvm install latest

panic: runtime error: slice bounds out of range [:1] with length 0

goroutine 1 [running]:
main.versionNumberFrom({0x0, 0x0})
C:/Users/corey/OneDrive/Documents/workspace/libraries/oss/coreybutler/nvm-windows/src/nvm.go:514 +0x44c
main.getVersion({0x9c9a078, 0x6}, {0x456b0d, 0x2}, {0x0, 0x0, 0x0})
C:/Users/corey/OneDrive/Documents/workspace/libraries/oss/coreybutler/nvm-windows/src/nvm.go:243 +0x403
main.install({0x9c9a078, 0x6}, {0x456b0d, 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

What did you expect to happen?

i'm expected install node latest version in my windows..

Version

1.1.11 or newer (Default)

Which version of Windows?

Windows 10 (Default)

Which locale?

Asian

Which shell are you running NVM4W in?

Command Prompt

User Permissions?

Administrative Privileges, Elevated

Is Developer Mode enabled?

None

Relevant log/console output

C:\Users\ ***>nvm install latest

panic: runtime error: slice bounds out of range [:1] with length 0

goroutine 1 [running]:
main.versionNumberFrom({0x0, 0x0})
        C:/Users/corey/OneDrive/Documents/workspace/libraries/oss/coreybutler/nvm-windows/src/nvm.go:514 +0x44c
main.getVersion({0x9c9a078, 0x6}, {0x456b0d, 0x2}, {0x0, 0x0, 0x0})
        C:/Users/corey/OneDrive/Documents/workspace/libraries/oss/coreybutler/nvm-windows/src/nvm.go:243 +0x403
main.install({0x9c9a078, 0x6}, {0x456b0d, 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

Debug Output

Running version 1.1.11.

Usage:

  nvm arch                     : Show if node is running in 32 or 64 bit mode.
  nvm current                  : Display active version.
  nvm debug                    : Check the NVM4W process for known problems (troubleshooter).
  nvm install <version> [arch] : The version can be a specific version, "latest" for the latest current version, or "lts" for the
                                 most recent LTS version. Optionally specify whether to install the 32 or 64 bit version (defaults
                                 to system arch). Set [arch] to "all" to install 32 AND 64 bit versions.
                                 Add --insecure to the end of this command to bypass SSL validation of the remote download server.
  nvm list [available]         : List the node.js installations. Type "available" at the end to see what can be installed. Aliased as ls.
  nvm on                       : Enable node.js version management.
  nvm off                      : Disable node.js version management.
  nvm proxy [url]              : Set a proxy to use for downloads. Leave [url] blank to see the current proxy.
                                 Set [url] to "none" to remove the proxy.
  nvm node_mirror [url]        : Set the node mirror. Defaults to https://nodejs.org/dist/. Leave [url] blank to use default url.
  nvm npm_mirror [url]         : Set the npm mirror. Defaults to https://github.com/npm/cli/archive/. Leave [url] blank to default url.
  nvm uninstall <version>      : The version must be a specific version.
  nvm use [version] [arch]     : Switch to use the specified version. Optionally use "latest", "lts", or "newest".
                                 "newest" is the latest installed version. Optionally specify 32/64bit architecture.
                                 nvm use <arch> will continue using the selected version, but switch to 32/64 bit mode.
  nvm root [path]              : Set the directory where nvm should store different versions of node.js.
                                 If <path> is not set, the current root will be displayed.
  nvm [--]version              : Displays the current running version of nvm for Windows. Aliased as v.

Anything else?

error install node

Can you run nvm debug and post the output. You just posted the help menu in he "Debug Output" section... running the debug command will provide more detail.

I have the exact same issue with version 1.1.10, nvm debug prints the help menu for me as well.

@ngergo6 upgrade to NVM4W 1.1.11.

@coreybutler my PATH got a bit messed up and even though I installed the latest version it still used the old one. Fixed it now and nvm is working fine. Thank you!

Same with me. There were old PATHS hanging even after uninstall. Manually removed all NVM related PATHS (both user and system) and reinstalled v 1.1.11 which seems to have fixed the issue.

Note: Uninstalling will remove all global NPM packages as well. This warning is shown during uninstall as well.

Closing since OP has not replied and the issue (as filed) appears to be due to an outdated version.