From 1c398a4486a1527d12a060a73ecb4d6825b06727 Mon Sep 17 00:00:00 2001 From: Yong Zhao Date: Tue, 4 Aug 2015 15:07:36 -0400 Subject: [PATCH] fix issues related to showing the arch of installed node --- src/nvm/node/node.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/nvm/node/node.go b/src/nvm/node/node.go index 455ea417..0e586d30 100644 --- a/src/nvm/node/node.go +++ b/src/nvm/node/node.go @@ -25,7 +25,17 @@ func GetCurrentVersion() (string, string) { cmd := exec.Command("node","-p","console.log(process.execPath)") str, _ := cmd.Output() file := strings.Trim(regexp.MustCompile("undefined").ReplaceAllString(string(str),"")," \n\r") - return v, arch.Bit(file) + bit := arch.Bit(file) + if (bit == "?"){ + cmd := exec.Command("node", "-e", "console.log(process.arch)" ) + str, err := cmd.Output() + if (string(str) == "x64") { + bit := "64" + } else { + bit := "32" + } + } + return v, bit } return "Unknown","" }