报错内容
Downloading npm version 6.9.0... Error while downloading https://github.com/npm/cli/archive/v6.9.0.zip - Get https://github.com/npm/cli/archive/v6.9.0.zip: unexpected EOF
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x20 pc=0x5c6eb0]
goroutine 1 [running]:
_/C_/Users/corey/Documents/workspace/nvm-windows/src/nvm/web.Download(0x112fc360, 0x2d, 0x11418000, 0x3e, 0x11441fc0, 0x5, 0x0)
C:/Users/corey/Documents/workspace/nvm-windows/src/nvm/web/web.go:68 +0x240
_/C_/Users/corey/Documents/workspace/nvm-windows/src/nvm/web.GetNpm(0x112fc4e1, 0x2a, 0x11441fc0, 0x5, 0x44)
C:/Users/corey/Documents/workspace/nvm-windows/src/nvm/web/web.go:163 +0x21b
main.install(0x112f80e0, 0x7, 0x660283, 0x2)
C:/Users/corey/Documents/workspace/nvm-windows/src/nvm.go:268 +0x626
main.main()
C:/Users/corey/Documents/workspace/nvm-windows/src/nvm.go:78 +0x8cd
解决
① 进入nvm的安装目录下找到
settings.txt 文本双击
② 配置文本 添加如下:(注意:有空格)
node_mirror: http://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/