abpframework/abp · error · Exception

Package is not found or downloadable!

Error message

Package is not found or downloadable!

What it means

Thrown by `NpmPackageInfoProvider.GetAsync` when the package list fetched from abp.io's npmPackages endpoint does not contain a package with the requested name. It is a raw `Exception`.

Source

Thrown at framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/NpmPackageInfoProvider.cs:41

        ICancellationTokenProvider cancellationTokenProvider,
        IRemoteServiceExceptionHandler remoteServiceExceptionHandler,
        CliHttpClientFactory cliHttpClientFactory)
    {
        JsonSerializer = jsonSerializer;
        CancellationTokenProvider = cancellationTokenProvider;
        RemoteServiceExceptionHandler = remoteServiceExceptionHandler;
        _cliHttpClientFactory = cliHttpClientFactory;
    }

    public async Task<NpmPackageInfo> GetAsync(string name)
    {
        var packageList = await GetPackageListAsync();

        var package = packageList.FirstOrDefault(m => m.Name == name);

        if (package == null)
        {
            throw new Exception("Package is not found or downloadable!");
        }

        return package;
    }

    public async Task<List<NpmPackageInfo>> GetPackageListAsync()
    {
        var client = _cliHttpClientFactory.CreateClient();

        using (var responseMessage = await client.GetAsync(
            $"{CliUrls.WwwAbpIo}api/download/npmPackages/",
            CancellationTokenProvider.Token
        ))
        {
            await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(responseMessage);
            var result = await responseMessage.Content.ReadAsStringAsync();
            return JsonSerializer.Deserialize<List<NpmPackageInfo>>(result);
        }

View on GitHub (pinned to 7ed43b1931)

Solutions

  1. Verify the exact npm package name on abp.io/npm and retry.
  2. Check spelling and casing of the requested package name.
  3. Confirm network connectivity so the full package list is returned; retry on transient failures.
Defensive patterns

Strategy: validation

Validate before calling

var packages = await npmProvider.GetPackageListAsync();
if (!packages.Any(p => string.Equals(p.Name, name, StringComparison.OrdinalIgnoreCase)))
    throw new ArgumentException($"npm package '{name}' not found.");

Type guard

static async Task<bool> NpmPackageExistsAsync(NpmPackageInfoProvider provider, string name)
{
    var list = await provider.GetPackageListAsync();
    return list.Any(p => string.Equals(p.Name, name, StringComparison.OrdinalIgnoreCase));
}

Try / catch

try { await npmProvider.GetAsync(name); }
catch (Exception ex) when (ex.Message.Contains("Package is not found"))
{
    logger.LogError("npm package '{Name}' not found or not downloadable.", name);
    throw;
}

Prevention

When it happens

Trigger: Requesting npm package info (e.g. for LeptonX/theme packages) with a name not present in the remote npm package list.

Common situations: Typo in the npm package name; package renamed/deprecated; commercial package requested without entitlement; partial list returned due to network issues.

Related errors


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