在安装含巧克力的软件包时遇到麻烦:
例如(无论使用哪种软件包,都会出现相同的错误)
dtc-msys2 not installed. An error occurred during installation:
String cannot be of zero length.
Parameter name: variable
更详细的日志:
C:\WINDOWS\system32>choco install dtc-msys2 -v --debug
Chocolatey v0.10.15
Chocolatey is running on Windows v 10.0.18362.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" install dtc-msys2 -v --debug
Received arguments: install dtc-msys2 -v --debug
RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
Sending message 'PreRunMessage' out if there are subscribers...
[Pending] Removing all pending packages that should not be considered installed...
[Pending] Removing incomplete install for 'dtc-msys2'
Performing validation checks.
Global Configuration Validation Checks:
- Package Exit Code / Exit On Reboot = Checked
System State Validation Checks:
Reboot Requirement Checks:
- Pending Computer Rename = Checked
- Pending Component Based Servicing = Checked
- Pending Windows Auto Update = Checked
- Pending File Rename Operations = Ignored
- Pending Windows Package Installer = Checked
- Pending Windows Package Installer SysWow64 = Checked
The source 'https://chocolatey.org/api/v2/' evaluated to a 'normal' source type
NOTE: Hiding sensitive configuration data! Please double and triple
check to be sure no sensitive data is shown, especially if copying
output to a gist for review.
Configuration: CommandName='install'|
CacheLocation='C:\Users\RainA\AppData\Local\Temp\chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://chocolatey.org/api/v2/'|SourceType='normal'|
Debug='True'|Verbose='True'|Trace='False'|Force='False'|Noop='False'|
HelpRequested='False'|UnsuccessfulParsing='False'|RegularOutput='True'|
QuietOutput='False'|PromptForConfirmation='False'|
AcceptLicense='False'|
AllowUnofficialBuild='False'|Input='dtc-msys2'|AllVersions='False'|
SkipPackageInstallProvider='False'|PackageNames='dtc-msys2'|
Prerelease='False'|ForceX86='False'|OverrideArguments='False'|
NotSilent='False'|ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|AllowDowngrade='False'|
ForceDependencies='False'|Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.18362.0'|
Information.PlatformName='Windows 10'|
Information.ChocolateyVersion='0.10.15.0'|
Information.ChocolateyProductVersion='0.10.15'|
Information.FullName='choco, Version=0.10.15.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|
Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='True'|
Information.UserName='RainA'|
Information.UserDomainName='LAPTOP-P5OL4LGT'|
Information.IsUserAdministrator='True'|
Information.IsUserSystemAccount='False'|
Information.IsUserRemoteDesktop='False'|
Information.IsUserRemote='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|Information.LicenseType='Foss'|
Information.CurrentDirectory='C:\WINDOWS\system32'|
Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.LogWithoutColor='False'|
Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseEnhancedExitCodes='False'|
Features.UseFipsCompliantChecksums='False'|
Features.ShowNonElevatedWarnings='True'|
Features.ShowDownloadProgress='True'|
Features.StopOnFirstPackageFailure='False'|
Features.UseRememberedArgumentsForUpgrades='False'|
Features.IgnoreUnfoundPackagesOnUpgradeOutdated='False'|
Features.SkipPackageUpgradesWhenNotInstalled='False'|
Features.RemovePackageInformationOnUninstall='False'|
Features.ExitOnRebootDetected='False'|
Features.LogValidationResultsOnWarnings='True'|
Features.UsePackageRepositoryOptimizations='True'|
Features.ScriptsCheckLastExitCode='False'|
ListCommand.LocalOnly='False'|
ListCommand.IdOnly='False'|ListCommand.IncludeRegistryPrograms='False'|
ListCommand.PageSize='25'|ListCommand.Exact='False'|
ListCommand.ByIdOnly='False'|ListCommand.ByTagOnly='False'|
ListCommand.IdStartsWith='False'|ListCommand.OrderByPopularity='False'|
ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|
ListCommand.IncludeVersionOverrides='False'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
UpgradeCommand.ExcludePrerelease='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|SourceCommand.BypassProxy='False'|
SourceCommand.AllowSelfService='False'|
SourceCommand.VisibleToAdminsOnly='False'|
FeatureCommand.Command='unknown'|ConfigCommand.Command='unknown'|
ApiKeyCommand.Remove='False'|PinCommand.Command='unknown'|
OutdatedCommand.IgnorePinned='False'|Proxy.BypassOnLocal='True'|
_ Chocolatey:ChocolateyInstallCommand - Normal Run Mode _
Installing the following packages:
dtc-msys2
By installing you accept licenses for the packages.
Using 'https://chocolatey.org/api/v2/'.
- Supports prereleases? 'True'.
- Is ServiceBased? 'True'.
Package 'dtc-msys2' found on source 'https://chocolatey.org/api/v2/'
[NuGet] Installing 'dtc-msys2 1.4.7'.
[NuGet] Added file 'chocolateyinstall.ps1' to folder 'dtc-msys2\tools'.
[NuGet] Added file 'dtc-1.4.7-1-i686.pkg.tar.xz' to folder 'dtc-msys2\tools'.
[NuGet] Added file 'dtc-1.4.7-1-x86_64.pkg.tar.xz' to folder 'dtc-msys2\tools'.
[NuGet] Added file 'gcc-libs-7.3.0-3-i686.pkg.tar.xz' to folder 'dtc-msys2\tools'.
[NuGet] Added file 'gcc-libs-7.3.0-3-x86_64.pkg.tar.xz' to folder 'dtc-msys2\tools'.
[NuGet] Added file 'LICENSE.txt' to folder 'dtc-msys2\tools'.
[NuGet] Added file 'msys2-runtime-2.11.1-2-i686.pkg.tar.xz' to folder 'dtc-msys2\tools'.
[NuGet] Added file 'msys2-runtime-2.11.1-2-x86_64.pkg.tar.xz' to folder 'dtc-msys2\tools'.
[NuGet] Added file 'VERIFICATION.txt' to folder 'dtc-msys2\tools'.
[NuGet] Added file 'dtc-msys2.nupkg' to folder 'dtc-msys2'.
[NuGet] Added file 'dtc-msys2.nuspec' to folder 'dtc-msys2'.
[NuGet] Successfully installed 'dtc-msys2 1.4.7'.
dtc-msys2 v1.4.7 [Approved]
dtc-msys2 package files install completed. Performing other installation steps.
dtc-msys2 not installed. An error occurred during installation:
String cannot be of zero length.
Parameter name: variable
Chocolatey installed 0/0 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Sending message 'PostRunMessage' out if there are subscribers...
Chocolatey had an error occur:
System.IO.IOException: The process cannot access the file 'C:\ProgramData\chocolatey\lib\dtc-msys2\.chocolateyPending' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at chocolatey.infrastructure.filesystem.DotNetFileSystem.get_file_encoding(String filePath)
at chocolatey.infrastructure.filesystem.DotNetFileSystem.write_file(String filePath, String fileText)
at chocolatey.infrastructure.app.services.ChocolateyPackageService.set_pending(PackageResult packageResult, ChocolateyConfiguration config)
at chocolatey.infrastructure.app.services.ChocolateyPackageService.handle_package_result(PackageResult packageResult, ChocolateyConfiguration config, CommandNameType commandName)
at chocolatey.infrastructure.app.services.NugetService.install_run(ChocolateyConfiguration config, Action`1 continueAction)
at chocolatey.infrastructure.app.services.ChocolateyPackageService.perform_source_runner_function[T](ChocolateyConfiguration config, Func`2 function)
at chocolatey.infrastructure.app.services.ChocolateyPackageService.install_run(ChocolateyConfiguration config)
at chocolatey.infrastructure.app.runners.GenericRunner.run(ChocolateyConfiguration config, Container container, Boolean isConsole, Action`1 parseArgs)
at chocolatey.infrastructure.app.runners.ConsoleApplication.run(String[] args, ChocolateyConfiguration config, Container container)
at chocolatey.console.Program.Main(String[] args)
Exiting with 1
有人知道这个问题的根源吗?
答案 0 :(得分:1)
弄清楚了。在GitHub(https://github.com/chocolatey/choco/issues/1933)中报告了类似的问题,结果发现我安装了相同的Microchip WinCUPL软件。卸载WinCUPL解决了该问题。