项目场景
最近学习Vue2.0需要用到Node.js,但没有成功安装node.js的依赖,担心以后还会遇到其他问题,遂广泛查找资料,最终得以解决问题。
问题描述
在Node.js安装安装依赖工具时,遇到如下报错
WARNING: 'choco' was found at 'C:\ProgramData\chocolatey\bin\choco.exe'.
WARNING: An existing Chocolatey installation was detected. Installation will not continue.
For security reasons, this script will not overwrite existing installations.
Please use choco upgrade chocolatey to handle upgrades of Chocolatey itself.
Chocolatey v0.12.1
Upgrading the following packages:
python;visualstudio2019-workload-vctools
By upgrading, you accept licenses for the packages.
python is not installed. Installing...
python not installed. An error occurred during installation:
Unable to connect to the remote server
python package files upgrade failed with exit code 1. Performing other installation steps.
The upgrade of python was NOT successful.
python not installed. An error occurred during installation:
Unable to connect to the remote server
visualstudio2019-workload-vctools is not installed. Installing...
visualstudio2019-workload-vctools not installed. An error occurred during installation:
Unable to connect to the remote server
visualstudio2019-workload-vctools package files upgrade failed with exit code 1. Performing other installation steps.
The upgrade of visualstudio2019-workload-vctools was NOT successful.
visualstudio2019-workload-vctools not installed. An error occurred during installation:
Unable to connect to the remote server
Chocolatey upgraded 0/2 packages. 2 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures
- python (exited 1) - python not installed. An error occurred during installation:
Unable to connect to the remote server
- visualstudio2019-workload-vctools (exited 1) - visualstudio2019-workload-vctools not installed. An error occurred during installation:
Unable to connect to the remote server
原因分析
三个软件安装失败,分别是Chocolatey, visualstudio2019-workload-vctools, python。
解决方案
第一步:
首先去Wikipedia,明白chocolatey是什么,然后尝试寻找官方安装文档,果不其然找到了。
以下引用Wikipedia对chocolatey的描述:
Chocolatey是一个Windows下的软件包管理器,让用户可以像在类Unix系统中使用Yum和APT一样使用它,在Windows中实现自动化轻松管理Windows软件的所有方面(安装,配置,升级和卸载)。
第二步:
安装chocolatey
以下为官方文档的安装指导步骤
第三步
使用chocolatey
安装visualstudio2019-workload-vctools
官网安装步骤如下:
第四步
安装完成之后,重新点击node.js安装包,重新选择安装额外的工具,选项如下:
最终安装效果