一、报错内容及截图
我执行的命令是:npm install latest
,但是出现以下报错:
panic: runtime error: index out of range [3] with length 3
goroutine 1 [running]:
main.checkVersionExceedsLatest({0x1191d390, 0x6})
C:/Users/corey/OneDrive/Documents/workspace/libraries/oss/coreybutler/nvm-windows/src/nvm.go:875 +0x220
main.install({0x1189c090, 0x6}, {0x769d26, 0x2})
C:/Users/corey/OneDrive/Documents/workspace/libraries/oss/coreybutler/nvm-windows/src/nvm.go:308 +0x337
main.main()
C:/Users/corey/OneDrive/Documents/workspace/libraries/oss/coreybutler/nvm-windows/src/nvm.go:87 +0xaea
二、解决办法
升级nvm
至1.1.11
。下载链接:
https://github.com/coreybutler/nvm-windows/releases/download/1.1.11/nvm-update.zip
三、解决问题的策略
1. google查询
但是没解决。
2. 问chatgpt
chatgpt
其实解决了的,但是我一开始不相信:
3. github对应的仓库的issues搜索
搜索nvm
,找到作者的仓库:
https://github.com/coreybutler/nvm-windows
然后点进issues
,搜索关键词index out of range [3] with length 3
:
点进被关闭的issues
,直接就可以看到很多人再提问。甚至大佬不厌其烦的回复着:
文章来源:https://www.toymoban.com/news/detail-621005.html
文章来源地址https://www.toymoban.com/news/detail-621005.html
到了这里,关于【nvm安装npm出错】panic: runtime error: index out of range [3] with length 3的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!