当前位置:网站首页>使用nvm安装node成功,安装npm失败(Error while downloading,TLS handshake timeout)
使用nvm安装node成功,安装npm失败(Error while downloading,TLS handshake timeout)
2022-07-20 19:17:00 【金澜】
使用nvm安装nodejs时报以下错误:
C:\Users\Administrator>nvm install 18.6.0
Downloading node.js version 18.6.0 (64-bit)...
Complete
Downloading npm version 8.13.2... Error while downloading https://github.com/npm/cli/archive/v8.13.2.zip
- Get https://github.com/npm/cli/archive/v8.13.2.zip: net/http: TLS handshake timeout
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x20 pc=0x5c6eb0]
提示nodejs安装完成,但是npm下载失败,这一看就是网络原因,因为我看到了handshake timeout(握手超时)
字样,windows电脑没梯子,只能想其他办法。
解决方式1:修改镜像源
修改nvm(windows默认路径C:\Users\Administrator\AppData\Roaming\nvm
)的配置文件settings.txt
,将下面两行代码拷贝进settings.txt文件内保存,其他内容不用动,然后打开一个新的命令行重新使用nvm安装nodejs即可。
node_mirror: http://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/
如果想查看nodejs版本,可以使用nvm list available
:
C:\Users\Administrator>nvm list available
| CURRENT | LTS | OLD STABLE | OLD UNSTABLE |
|--------------|--------------|--------------|--------------|
| 18.6.0 | 16.16.0 | 0.12.18 | 0.11.16 |
| 18.5.0 | 16.15.1 | 0.12.17 | 0.11.15 |
| 18.4.0 | 16.15.0 | 0.12.16 | 0.11.14 |
| 18.3.0 | 16.14.2 | 0.12.15 | 0.11.13 |
| 18.2.0 | 16.14.1 | 0.12.14 | 0.11.12 |
| 18.1.0 | 16.14.0 | 0.12.13 | 0.11.11 |
| 18.0.0 | 16.13.2 | 0.12.12 | 0.11.10 |
| 17.9.1 | 16.13.1 | 0.12.11 | 0.11.9 |
| 17.9.0 | 16.13.0 | 0.12.10 | 0.11.8 |
| 17.8.0 | 14.20.0 | 0.12.9 | 0.11.7 |
| 17.7.2 | 14.19.3 | 0.12.8 | 0.11.6 |
| 17.7.1 | 14.19.2 | 0.12.7 | 0.11.5 |
| 17.7.0 | 14.19.1 | 0.12.6 | 0.11.4 |
| 17.6.0 | 14.19.0 | 0.12.5 | 0.11.3 |
| 17.5.0 | 14.18.3 | 0.12.4 | 0.11.2 |
| 17.4.0 | 14.18.2 | 0.12.3 | 0.11.1 |
| 17.3.1 | 14.18.1 | 0.12.2 | 0.11.0 |
| 17.3.0 | 14.18.0 | 0.12.1 | 0.9.12 |
| 17.2.0 | 14.17.6 | 0.12.0 | 0.9.11 |
| 17.1.0 | 14.17.5 | 0.10.48 | 0.9.10 |
This is a partial list. For a complete list, visit https://nodejs.org/download/release
安装nodejs:
C:\Users\Administrator>nvm install 18.6.0
Downloading node.js version 18.6.0 (64-bit)...
Complete
Downloading npm version 8.13.2... Complete
Installing npm v8.13.2...
Installation complete. If you want to use this version, type
nvm use 18.6.0
解决方式2:手动下载nodejs,修改文件夹名称,拷贝到nvm文件夹下
nodejs各个版本下载地址:https://registry.npmmirror.com/binary.html?path=node/
根据自己的电脑,选择一个版本的压缩文件下载,下载完成之后解压,然后修改名称为nvm支持的文件夹名称
修改文件夹名称为v16.13.1
使用nvm指令查看当前node以及npm是否可用:
C:\Users\Administrator>nvm list
18.6.0
16.16.0
16.15.1
16.13.1
* 14.19.3 (Currently using 64-bit executable)
C:\Users\Administrator>nvm use 16.13.1
Now using node v16.13.1 (64-bit)
C:\Users\Administrator>nvm list
18.6.0
16.16.0
16.15.1
* 16.13.1 (Currently using 64-bit executable)
14.19.3
C:\Users\Administrator>node -v
v16.13.1
C:\Users\Administrator>npm -v
8.1.2
边栏推荐
- Trust reverse traversal rev()
- Codeforces Round #808 (Div. 2)(A~D)
- 活动报名|揭露 Apache Doris 数据湖分析技术内幕?稀土开发者大会免费报名中!
- IIC通信协议
- EasyGBS平台设置小技巧:如何隐藏平台web页面不被访问?
- Differences between grouping query and filtering
- 【WebFace260M】《WebFace260M:A Benchmark Unveiling the Power of Million-Scale Deep Face Recognition》
- 测试计划应包括的内容
- Reverse string - Intermediate recursion
- IO文件输入输出流
猜你喜欢
Detailed explanation of zero length array in C language (2)
Unity API details - GameObject class
Crazy God redis notes 04
MySQL --- 多表查询 - 七种JOINS实现、集合运算、多表查询练习
Help enterprises' digital upgrading, and volcano engine releases cloud growth solutions
Set shell script to start automatically
C# 同步 异步 回调 状态机 async await Demo
Know and use log tool Loki
Codeforces Round #809 (Div. 2)(A~D2)
设置Shell脚本开机自启
随机推荐
Niuke topic - common methods to judge whether a linked list is palindrome structure, median in data flow, and PriorityQueue
Ireport export PDF font bold failure
EasyNVS定制项目中的播放器更新及相应新功能增加
重鏈剖分鏈加與極值
PCL计算点云粗糙度
经典重温:理解神经网络的“知识一致性”(ICLR 2020)
BCG 本地化
【Homography Estimation】《Deep Image Homography Estimation》
嵌入式工程师,用好C语言这一利器的三要素
What are the main aspects of troubleshooting when DTS write module delays writing to the target database?
元宇宙:技术演进、产业生态与大国博弈
【软件测试】测试中的风险有哪些?
Comparison of five classic code readers
【安装PG】
TF 坐标变换
【MLFP】《Face Presentation Attack with Latex Masks in Multispectral Videos》
哎,系统分析师下午没过
ThreadLocal父子线程传递问题——熟悉阿里的TransmittableThreadLocal
Trust reverse traversal rev()
A CD and a floppy disk