首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从powershel安装软件包时出现错误的原因

从powershel安装软件包时出现错误的原因
EN

Stack Overflow用户
提问于 2020-09-03 02:37:51
回答 1查看 384关注 0票数 0

我一直试图从PowerShell管理包,但看起来PowerShell给出了错误,因为他找不到包或它的依赖项(我使用巧克力作为源)、命令和结果:

代码语言:javascript
复制
register-packagesource -name chocolatey -providername chocolatey -location https://chocolatey.org/api/v2

Name                             ProviderName     IsTrusted  Location
----                             ------------     ---------  --------
chocolatey                       Chocolatey       False      https://chocolatey.org/api/v2
代码语言:javascript
复制
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.
代码语言:javascript
复制
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, SemanticVersion version, Boolean ignoreDependencies, Boolean allowPrereleaseVersions)
WARNING: NuGet:    at NuGet.Commands.InstallCommand.InstallPackage(IFileSystem fileSystem, String packageId, 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‘,正如您在下面看到的那样,以及您在第二个命令中看到的程序本身。我尝试用同样的方法安装其他包,但没有成功。

代码语言:javascript
复制
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

非常感谢您的帮助,提前谢谢您。

EN

回答 1

Stack Overflow用户

发布于 2020-09-03 11:01:02

查看this文章。我想这会有帮助的。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63711695

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档