|
|

楼主 |
发表于 2022-5-24 09:52:02
|
显示全部楼层
Node.js 安装工具 Install Additional Tools for Node.js时报错:
- 警告: 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.
复制代码
解决方法
1、删除 C:\ProgramData\chocolatey 这个空文件夹
提示已安装,执行命令 choco 命令不存在。原因:原来有 chocolatey 文件夹,但是无内容。
2、手动命令安装 choco
注意以管理员的方式运行。
Install with PowerShell.exe
With PowerShell, there is an additional step. You must ensure Get-ExecutionPolicy is not Restricted. We suggest using Bypass to bypass the policy to get things installed or AllSigned for quite a bit more security.
Run Get-ExecutionPolicy. If it returns Restricted, then run Set-ExecutionPolicy AllSigned or Set-ExecutionPolicy Bypass -Scope Process.
Now run the following command:
- Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
复制代码 安装成功!
- Chocolatey upgraded 18/18 packages.
- See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
- Upgraded:
- - chocolatey-dotnetfx.extension v1.0.1
- - visualstudio2019buildtools v16.11.15.0
- - kb3033929 v1.0.5
- - python3 v3.10.4
- - chocolatey-windowsupdate.extension v1.0.4
- - vcredist140 v14.32.31326
- - kb2999226 v1.0.20181019
- - visualstudio-installer v2.0.3
- - kb2919355 v1.0.20160915
- - chocolatey-core.extension v1.4.0
- - kb2919442 v1.0.20160915
- - chocolatey-visualstudio.extension v1.10.2
- - vcredist2015 v14.0.24215.20170201
- - chocolatey-compatibility.extension v1.0.0
- - dotnetfx v4.8.0.20190930
- - visualstudio2019-workload-vctools v1.0.1
- - kb3035131 v1.0.3
- - python v3.10.4
- Type ENTER to exit:
复制代码
Upgrading Chocolatey
Once installed, Chocolatey can be upgraded in exactly the same way as any other package that has been installed using Chocolatey. Simply use the command to upgrade to the latest stable release of Chocolatey:
|
|