neovim - Choco 无法删除输出文件:访问被拒绝
问题描述
我遇到了一个恼人的错误,我的目标是安装最新版本的 neovim(neovim 版本 .5)。我目前有neovim .4
- 我首先通过以下方式卸载了 neovim
choco uninstall neovim
- 然后我跑
choco install neovim --pre
了
ERROR: Can not delete output file : Access is denied. : C:\tools\neovim\Neovim\bin\lua51.dll
ERROR: Can not delete output file : Access is denied. : C:\tools\neovim\Neovim\bin\msgpackc.dll
ERROR: Can not delete output file : Access is denied. : C:\tools\neovim\Neovim\bin\nvim.exe
ERROR: Can not delete output file : Access is denied. : C:\tools\neovim\Neovim\bin\uv.dll
ERROR: Can not delete output file : Access is denied. : C:\tools\neovim\Neovim\bin\winpty.dll
ERROR: 7-Zip encountered a fatal error while extracting the files. This is most likely an issue with the 'neovim' package and not with Chocolatey itself. Please follow up with the package maintainer(s) directly.
The install of neovim was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\neovim\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
- neovim (exited 2) - Error while running 'C:\ProgramData\chocolatey\lib\neovim\tools\chocolateyinstall.ps1'.
See log for details.
错误中提到的日志文件如下所示:
2021-06-16 23:53:13,553 4908 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\neovim'
to 'C:\ProgramData\chocolatey\lib-bad\neovim'
2021-06-16 23:53:15,557 4908 [DEBUG] - Attempting to delete file "C:\Users\15732\AppData\Local\NuGet\Cache\neovim.0.5.0-beta.nupkg".
2021-06-16 23:53:16,104 4908 [WARN ] -
Chocolatey installed 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2021-06-16 23:53:16,104 4908 [INFO ] -
2021-06-16 23:53:16,104 4908 [ERROR] - Failures
2021-06-16 23:53:16,104 4908 [ERROR] - - neovim (exited 2) - Error while running 'C:\ProgramData\chocolatey\lib\neovim\tools\chocolateyinstall.ps1'.
See log for details.
2021-06-16 23:53:16,104 4908 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2021-06-16 23:53:16,135 4908 [DEBUG] - Exiting with 2
解决方案
运行应用程序时,DLL 和 exe 被锁定。您可能正在运行 Neovim 并尝试升级它(我刚刚重现了此错误以确认输出匹配),这解释了为什么它在重新启动 Windows 后工作。
如果您对 .dll 或 .exe 文件有“拒绝访问”,请确保您没有运行使用这些文件的应用程序。
此外,您在尝试卸载时可能遇到了同样的问题。您说您确实卸载了,但错误输出中的锁定文件之一是C:\tools\neovim\Neovim\bin\nvim.exe
,因此它仍然存在。
推荐阅读
- c++ - 矢量合并排序()没有任何反应
- javascript - 在 Zapier 中使用 Javascript 代码返回两个字母的 ISO 国家代码
- amazon-web-services - 如何在 AWS 上部署基础设施即代码
- php - 禁用动态向导表单输入
- ios - 在 iOS 13 上实例化 ViewController 崩溃
- python - 混合数据的有效网络不兼容大小
- apache-spark - Impala Hive 和 Spark Parquet 文件格式大小
- c++ - 将字符串列表拆分为组件
- vb.net - VB.NET设置密码长度保存在数据库中
- java - Java初学者;复制简单示例代码后出现错误?我的配置是不是乱了?