该文件是一个文本文件,但正尝试作为可执行文件运行 - 安装 vim

该文件是一个文本文件,但正尝试作为可执行文件运行 - 安装 vim

我正在尝试使用 chocolately 安装 vim

PS C:\opt1\abc> choco install -y vim
Chocolatey v0.10.15
Installing the following packages:
vim
By installing you accept licenses for the packages.
Progress: Downloading vim 8.0.604... 100%

vim v8.0.604 [Approved]
vim package files install completed. Performing other installation steps.
Downloading vim
  from 'https://sourceforge.net/projects/cream/files/Vim/8.0.604/gvim-8-0-604.exe/download'
WARNING: C:\Users\Administrator\AppData\Local\Temp\2\chocolatey\vim\8.0.604\download is of content type text/html
Progress: 100% - Completed download of C:\Users\Administrator\AppData\Local\Temp\2\chocolatey\vim\8.0.604\download (746
B).
Download of download (746 B) completed.
Installing vim...
WARNING: Write-ChocolateyFailure is deprecated and will be removed in v2. If you are the package maintainer, please use
'throw $_.Exception' instead.
ERROR: The file was a text file but is attempting to be run as an executable - 'C:\Users\Administrator\AppData\Local\Tem
p\2\chocolatey\vim\8.0.604\download'
The install of vim was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\vim\tools\chocolateyInstall.ps1'.
 See log for details.

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - vim (exited 4) - Error while running 'C:\ProgramData\chocolatey\lib\vim\tools\chocolateyInstall.ps1'.
 See log for details.

我指定了错误的软件包吗?我该如何修复?

答案1

正如在顶部(目前 5 个月前)的评论中指出的那样Vim 的 Chocolatey 页面,该包似乎从错误的 URL 拉取(请参阅下面的安装脚本Files),并且可能返回一个.html文件,而不是可执行文件。正确的 URL 目前是:

https://ftp.nluug.nl/pub/vim/pc/gvim81.exe

根据Vim 的官方网站。需要更新包 URL 才能从该链接提取。

相关内容