Downloading node.js version 14.16.1 (64-bit)... Complete Downloading npm version 6.14.12... Error while downloading https://github.com/npm/cli/archive/v6.14.12.zip - Get "https://github.com/npm/cli/archive/v6.14.12.zip": dial tcp 20.205.243.166:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. Could not download npm for node v14.16.1. Please visit https://github.com/npm/cli/releases/tag/v6.14.12 to download npm. It should be extracted to D:\nvm\nvm\v14.16.1
当我们利用node版本管理工具安装一个node版本的时,有时候会遇到上述报错,这是因为网络连接问题而安装不上node自带的npm,下面教大家如何手动安装npm。
1、条件是利用nvm安装node安装成功、但是npm没有安装成功,首先我们要去具体网址下载与之相对应的npm版本
https://github.com/npm/cli/releases
2、下载好压缩包之后解压并将文件命名npm
3、找到自己电脑nvm的地址
进入安装不成功的版本,打开node_modules文件将刚才下好的npm包复制到这里面,打开npm文件
将npm、npm.cmd文件复制到v14.16.1的文件加下(具体哪个文件夹要根据自己的版本而定)
4、验证是否安装成功
打开shell输入node -v
和npm -v
命令如果出现具体版本那就证明手动安装成功。