abpframework/abp · error · CliUsageException
Specified directory does not exist.
Error message
Specified directory does not exist.
What it means
JavaScriptServiceProxyGenerator.CheckWorkDirectory mirrors the C# generator's first check: Directory.Exists(directory) is false, so the work directory supplied to the JS/TS proxy generator does not exist on disk.
Source
Thrown at framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ServiceProxying/JavaScript/JavaScriptServiceProxyGenerator.cs:79
{
return ServiceType.Application;
}
private void RemoveProxy(GenerateProxyArgs args, string filePath)
{
if (File.Exists(filePath))
{
File.Delete(filePath);
}
Logger.LogInformation($"Delete {GetLoggerOutputPath(filePath, args.WorkDirectory)}");
}
private static void CheckWorkDirectory(string directory)
{
if (!Directory.Exists(directory))
{
throw new CliUsageException("Specified directory does not exist.");
}
var projectFiles = Directory.GetFiles(directory, "*.csproj");
if (!projectFiles.Any())
{
throw new CliUsageException(
"No project file found in the directory. The working directory must have a Web project file.");
}
}
private static string RemoveInitializedEventTrigger(string script)
{
return script.Replace(EventTriggerScript, string.Empty);
}
}
View on GitHub (pinned to 7ed43b1931)
Solutions
- Verify the directory exists: 'ls <work-directory>'.
- Use an absolute path for --work-directory.
- Run from inside the Web project folder without --work-directory so cwd is used.
Example fix
// before abp generate-proxy -t js -wd ./Acme.App.Web // after abp generate-proxy -t js -wd /repo/src/Acme.App.Web
Defensive patterns
Strategy: validation
Validate before calling
if (!Directory.Exists(workDirectory))
{ Console.Error.WriteLine($"Work directory '{workDirectory}' does not exist."); return; } Prevention
- Use absolute paths for --work-directory.
- Validate directory existence before invoking the JS proxy generator.
When it happens
Trigger: Running 'abp generate-proxy -t js' (or ts) with a --work-directory that does not exist, or running from a deleted/renamed folder.
Common situations: Typo in path; relative path resolved against an unexpected cwd; directory removed by a clean step; CI checkout mismatch.
Related errors
- Specified directory does not exist.
- package.json file not found
- angular.json file not found. You must run this command in th
- Option folder should be a directory.
- No project file found in the directory. The working director
AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13).
Data as JSON: /api/errors/e0994a9f850e677b.
Report an issue: GitHub.