{"record":{"id":"fbb2c27a53d27e22","repo":"abpframework/abp","slug":"packagename-npm-package-could-not-be-found","errorCode":null,"errorMessage":"'{packageName}' npm package could not be found!","messagePattern":"'(.+?)' npm package could not be found!","errorType":"exception","errorClass":"CliUsageException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNpmPackageAdder.cs","lineNumber":247,"sourceCode":"        {\n            Logger.LogWarning(\"Cannot detect ABP package version. \" + ex.Message);\n        }\n\n        return null;\n    }\n\n    private async Task<NpmPackageInfo> FindNpmPackageInfoAsync(string packageName)\n    {\n        var url = $\"{CliUrls.WwwAbpIo}api/app/npmPackage/byName/?name=\" + packageName;\n        var client = CliHttpClientFactory.CreateClient();\n\n        using (var response = await client.GetAsync(url, CliHttpClientFactory.GetCancellationToken()))\n        {\n            if (!response.IsSuccessStatusCode)\n            {\n                if (response.StatusCode == HttpStatusCode.NotFound)\n                {\n                    throw new CliUsageException($\"'{packageName}' npm package could not be found!\");\n                }\n\n                await RemoteServiceExceptionHandler.EnsureSuccessfulHttpResponseAsync(response);\n            }\n\n            var responseContent = await response.Content.ReadAsStringAsync();\n            return JsonSerializer.Deserialize<NpmPackageInfo>(responseContent);\n        }\n    }\n}\n","sourceCodeStart":229,"sourceCodeEnd":258,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/ProjectNpmPackageAdder.cs#L229-L258","documentation":"FindNpmPackageInfoAsync GETs www.abp.io/api/app/npmPackage/byName/?name=<packageName> and throws a CliUsageException when the response status is 404 NotFound. A 404 means the package is not registered in the ABP package metadata catalog (which is distinct from the public npm registry). Other non-success codes fall through to RemoteServiceExceptionHandler.","triggerScenarios":"Running 'abp add-package <name>' for an NPM-scoped ABP package whose name is not catalogued, or any call to ProjectNpmPackageAdder.AddAsync with a packageName the server does not recognize.","commonSituations":"Misspelled package name; package only available in a newer ABP version than the CLI/server catalog; mixing commercial '@abp/...' names with free '@volo/...' namespaces; passing a non-ABP package name to the ABP catalog endpoint.","solutions":["Confirm the exact package name on the ABP docs/npm (mind the @abp/* vs @volo/* scope) and re-run.","Upgrade the ABP CLI so its catalog query matches the current package list.","If the package is a plain npm package, install it directly with 'npm install' instead of 'abp add-package'."],"exampleFix":"// before\nabp add-package @volo/abp.ng.theme   // wrong scope\n// after\nabp add-package @volo/abp.ng.theme","handlingStrategy":"validation","validationCode":"using var http = new HttpClient();\nvar resp = await http.GetAsync($\"https://www.abp.io/api/app/npmPackage/byName/?name={packageName}\");\nif (resp.StatusCode == HttpStatusCode.NotFound)\n{ Console.Error.WriteLine($\"Package '{packageName}' not in ABP catalog.\"); return; }","typeGuard":null,"tryCatchPattern":"try { await ProjectNpmPackageAdder.AddAsync(packageName); }\ncatch (CliUsageException ex) when (ex.Message.Contains(\"npm package could not be found\"))\n{ Console.Error.WriteLine(ex.Message); }","preventionTips":["Keep a curated list of valid ABP NPM package names in your scripts.","Validate package names against npm registry or ABP docs before scripting installs."],"tags":["cli","npm","package-management","http","not-found"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}