为什么我从powershel安装软件包时出错

问题描述

我一直在尝试从PowerShell管理软件包,但是它似乎在显示PowerShell,因为他找不到软件包或其依赖项而出错(我使用Chocolatey作为源) 命令和结果:

register-packagesource -name chocolatey -providername chocolatey -location https://chocolatey.org/api/v2

Name                             ProviderName     IsTrusted  Location
----                             ------------     ---------  --------
chocolatey                       Chocolatey       False      https://chocolatey.org/api/v2
find-package -providername chocolatey -name notepad

Name                           Version          Source           Summary
----                           -------          ------           -------
xml-notepad                    2.8.0.7          chocolatey       A simple XML editor.
crypto-notepad                 1.6.7            chocolatey       Crypto Notepad allows you to create secure notes using AES algorithms.
ProgrammersNotepad             2.4.2            chocolatey       Programmer's Notepad is a fast,lightweight text editor for Windows.
programmersnotepad.install     2.4.2            chocolatey       Programmer's Notepad is a fast,lightweight text editor for Windows.
notepad2                       4.2.25.20160422  chocolatey       A fast and light-weight Notepad-like text editor with syntax highlighting.
notepadplusplus.install        7.8.9            chocolatey       Notepad++ is a free (as in "free speech" and also as in "free beer") source code editor and Notepad replacement that supports several languages.
notepadplusplus                7.8.9            chocolatey       Notepad++ is a free (as in "free speech" and also as in "free beer") source code editor and Notepad replacement that supports several languages.
install-package -providername chocolatey -name notepadplusplus

The package(s) come(s) from a package source that is not marked as trusted.
Are you sure you want to install software from 'chocolatey'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): A
WARNING: NuGet: System.InvalidOperationException: Unable to find version '1.3.5.1' of package 'chocolatey-core.extension'.
WARNING: NuGet:    at NuGet.PackageRepositoryHelper.ResolvePackage(IPackageRepository sourceRepository,IPackageRepository localRepository,IPackageConstraintProvider constraintProvider,String packageId,SemanticVersion version,Boolean allowPrereleaseVersions)
WARNING: NuGet:    at NuGet.PackageManager.InstallPackage(String packageId,Boolean ignoreDependencies,Boolean allowPrereleaseVersions)
WARNING: NuGet:    at NuGet.Commands.InstallCommand.InstallPackage(IFileSystem fileSystem,SemanticVersion version)
WARNING: NuGet:    at NuGet.Program.Main(String[] args)
WARNING: NuGet: System.InvalidOperationException: Unable to find version '7.8.9' of package 'notepadplusplus.install'.
WARNING: NuGet: System.InvalidOperationException: Unable to find version '7.8.9' of package 'notepadplusplus'.

从我从install-package命令后的错误中了解到的是找不到程序和程序依赖项的错误。尽管我确实设法使用find-package找到了“ chocolatey-core.extension”,如下面所示,以及程序本身,如第二条命令所示。我尝试以相同的方式安装其他软件包,但没有成功。

find-package -providername chocolatey -name chocolatey-core.extension

Name                           Version          Source           Summary
----                           -------          ------           -------
chocolatey-core.extension      1.3.5.1          chocolatey       Helper functions extending core choco functionality

非常感谢所有帮助,谢谢。

解决方法

查看this文章。我认为这会有所帮助。

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...