![](/img/trans.png)
[英]What is the difference betwee “nuget install” , “Install-Package” and “choco install”?
[英]Find-Package works but Install-Package shows only nuget error using chocolatey in powershell
我剛剛開始在我的個人編程項目中使用 Windows。 我正在以管理員身份在 Powershell 5.1 中嘗試以下操作:
PS >install-package nodejs -providername Chocolatey
我收到以下錯誤:
WARNING: NuGet: System.InvalidOperationException: Unable to find version '13.12.0' of package 'nodejs.install'.
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)
即使這只是一個警告,該軟件包也沒有安裝:
PS >get-package nodejs
get-package : No package found for 'nodejs'.
一些顯示包環境的命令。 我真正做的就是安裝 Chocolatey,將其設置為受信任,然后注冊源:
PS >find-package nodejs -providername Chocolatey
Name Version Source Summary
---- ------- ------ -------
nodejs 13.12.0 chocolatey Node JS - Evented I/O for v8 JavaScript.
PS >get-packagesource
Name ProviderName IsTrusted Location
---- ------------ --------- --------
chocolatey Chocolatey True http://chocolatey.org/api/v2/
PSGallery PowerShellGet False https://www.powershellgallery.com/api/v2
PS >get-executionpolicy
AllSigned
這適用於示例中常用的其他軟件包,例如 vlc。 謝謝。
解決。 我正在輸入“y”以響應“您確定...”查詢而不是“Y”。 我被延遲和警告拋棄了,而不是立即終止。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.