abpframework/abp · error · CliUsageException

ERROR: '{moduleName}' module could not be found!

Error message

ERROR: '{moduleName}' module could not be found!

What it means

SolutionModuleAdder.FindModuleInfoAsync GETs www.abp.io/api/app/module/byNameWithDetails/?name=<moduleName> and throws a CliUsageException on 404 NotFound when the module is not in the catalog (after the newProTemplate early-return path is skipped). The message is prefixed 'ERROR: ' and names the missing module.

Source

Thrown at framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs:790

    protected virtual async Task<ModuleWithMastersInfo> GetModuleInfoAsync(string moduleName, bool newTemplate,
        bool newProTemplate = false)
    {
        if (newTemplate || newProTemplate)
        {
            return GetEmptyModuleProjectInfo(moduleName, newProTemplate);
        }

        var url = $"{CliUrls.WwwAbpIo}api/app/module/byNameWithDetails/?name=" + moduleName;
        var client = _cliHttpClientFactory.CreateClient();

        using (var response = await client.GetAsync(url, _cliHttpClientFactory.GetCancellationToken()))
        {
            if (!response.IsSuccessStatusCode)
            {
                if (response.StatusCode == HttpStatusCode.NotFound)
                {
                    throw new CliUsageException($"ERROR: '{moduleName}' module could not be found!");
                }

                await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(response);
            }

            var responseContent = await response.Content.ReadAsStringAsync();
            return JsonSerializer.Deserialize<ModuleWithMastersInfo>(responseContent);
        }
    }

    private ModuleWithMastersInfo GetEmptyModuleProjectInfo(string moduleName,
        bool newProTemplate = false)
    {
        var module = new ModuleWithMastersInfo
        {
            Name = moduleName,
            DisplayName = moduleName,
            MasterModuleInfos = new List<ModuleWithMastersInfo>()

View on GitHub (pinned to 7ed43b1931)

Solutions

  1. Verify the exact module name in ABP docs (e.g. 'Blogging', 'IdentityServer', 'AuditLogging') and re-run.
  2. For commercial modules, ensure you are logged in with a licensed account ('abp login').
  3. Upgrade the ABP CLI so the catalog query matches the current module list.

Example fix

// before
abp add-module Bloging
// after
abp add-module Blogging
Defensive patterns

Strategy: validation

Validate before calling

using var http = new HttpClient();
var resp = await http.GetAsync($"https://www.abp.io/api/app/module/byNameWithDetails/?name={moduleName}");
if (resp.StatusCode == HttpStatusCode.NotFound)
{ Console.Error.WriteLine($"Module '{moduleName}' not in catalog."); return; }

Try / catch

try { await SolutionModuleAdder.AddAsync(moduleName); }
catch (CliUsageException ex) when (ex.Message.Contains("module could not be found"))
{ Console.Error.WriteLine(ex.Message); }

Prevention

When it happens

Trigger: Running 'abp add-module <name>' with a module name the server does not recognise; passing a Pro module name while not licensed (so the catalog rejects it); typo in the module identifier.

Common situations: Misspelled module name (e.g. 'Bloging' vs 'Blogging'); requesting a Pro module without a license; module renamed or merged in a newer ABP version; mismatch between CLI version and server-side catalog.

Related errors


AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13). Data as JSON: /api/errors/17633c64419527aa. Report an issue: GitHub.