chocolatey/choco · error · ApplicationException
A single package name is required to run the choco info comm
Error message
A single package name is required to run the choco info command.
What it means
The info command (a synonym for 'choco search <pkg> --exact --detailed') requires exactly one package name. Validate() throws if configuration.Input is blank, because there is nothing to look up.
Source
Thrown at src/chocolatey/infrastructure.app/commands/ChocolateyInfoCommand.cs:96
"Include Configured Sources - When using the '--source' option, this appends the sources that have been saved into the chocolatey.config file by 'source' command. Available in 2.3.0+",
option => configuration.IncludeConfiguredSources = option != null)
;
}
public override void ParseAdditionalArguments(IList<string> unparsedArguments, ChocolateyConfiguration configuration)
{
configuration.Input = string.Join(" ", unparsedArguments);
configuration.Verbose = true;
configuration.ListCommand.Exact = true;
}
public override void Validate(ChocolateyConfiguration configuration)
{
base.Validate(configuration);
if (string.IsNullOrWhiteSpace(configuration.Input))
{
throw new ApplicationException("A single package name is required to run the choco info command.");
}
// Validate only a single package has been passed to info
// TODO: Provide ability to get info on a list of packages. See https://github.com/chocolatey/choco/issues/2905
var input = configuration.Input.Split(' ');
if (input.Length > 1)
{
throw new ApplicationException("Only a single package name can be passed to the choco info command.");
}
}
public override void HelpMessage(ChocolateyConfiguration configuration)
{
this.Log().Info(ChocolateyLoggers.Important, "Info Command");
this.Log().Info(@"
Chocolatey will perform a search for a package local or remote and provide
detailed information about that package. This is a synonym for
`choco search <pkgname> --exact --detailed`.
View on GitHub (pinned to 0d5abdd10c)
Solutions
- Supply a package name: 'choco info <pkg>'.
- In scripts, guard the call so it only runs when the package variable is non-empty.
- Use 'choco search' if you want optional/empty queries.
Example fix
# before choco info # after choco info chocolatey
Defensive patterns
Strategy: validation
Validate before calling
// Ensure a package name before calling info.
if (string.IsNullOrWhiteSpace(pkg))
{
throw new InvalidOperationException("choco info requires a package name");
}
RunChoco($"info {pkg}"); Prevention
- Assert the package variable is non-empty in scripts.
- Use 'choco search' for optional/empty queries instead of info.
When it happens
Trigger: Running 'choco info' with no package name argument at all.
Common situations: Running a bare 'choco info'; scripting that builds the command without a package variable; a variable expanding to empty.
Related errors
- Only a single package name can be passed to the choco info c
- Package name is required. Please pass at least one package n
- Package name cannot point directly to a local, or remote fil
- Package name cannot point directly to a package manifest fil
- Package name cannot be a path to a file
AI-assisted analysis of chocolatey/choco@0d5abdd10c (2026-08-13).
Data as JSON: /api/errors/575e71ca029eebf0.
Report an issue: GitHub.