{"record":{"id":"460352d32c2260a7","repo":"abpframework/abp","slug":"specified-directory-does-not-exist-460352","errorCode":null,"errorMessage":"Specified directory does not exist.","messagePattern":"Specified directory does not exist\\.","errorType":"validation","errorClass":"CliUsageException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/InstallLibsCommand.cs","lineNumber":38,"sourceCode":"\n    public InstallLibsCommand(IInstallLibsService installLibsService)\n    {\n        InstallLibsService = installLibsService;\n        Logger = NullLogger<InstallLibsCommand>.Instance;\n    }\n\n    public async Task ExecuteAsync(CommandLineArgs commandLineArgs)\n    {\n        var workingDirectoryArg = commandLineArgs.Options.GetOrNull(\n            Options.WorkingDirectory.Short,\n            Options.WorkingDirectory.Long\n        );\n\n        var workingDirectory = workingDirectoryArg ?? Directory.GetCurrentDirectory();\n\n        if (!Directory.Exists(workingDirectory))\n        {\n            throw new CliUsageException(\n                \"Specified directory does not exist.\" +\n                Environment.NewLine + Environment.NewLine +\n                GetUsageInfo()\n            );\n        }\n\n        await InstallLibsService.InstallLibsAsync(workingDirectory);\n    }\n\n    public string GetUsageInfo()\n    {\n        var sb = new StringBuilder();\n\n        sb.AppendLine(\"\");\n        sb.AppendLine(\"Usage:\");\n        sb.AppendLine(\"\");\n        sb.AppendLine(\"  abp install-libs\");\n        sb.AppendLine(\"\");","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/InstallLibsCommand.cs#L20-L56","documentation":"Thrown by InstallLibsCommand.ExecuteAsync when the working directory (either from the -wd option or the current directory) does not exist on disk. The command resolves the working directory, then calls Directory.Exists() on it before delegating to InstallLibsService. If the path doesn't resolve to a real folder, it throws a CliUsageException with usage info.","triggerScenarios":"Passing a -wd/--working-directory option pointing to a nonexistent path, or running the command from a deleted/renamed current working directory. `!Directory.Exists(workingDirectory)` evaluates true.","commonSituations":"Typo in the -wd path, relative path that resolves incorrectly from the current shell context, the directory was deleted or moved between command construction and execution, or a CI pipeline using an outdated workspace path.","solutions":["Verify the directory path exists before running: `ls /path/to/project` to confirm","If using -wd, double-check the spelling and use an absolute path to avoid context ambiguity","If relying on current directory, ensure you are in the project root that contains package.json or abp.resourcemapping.js","Run `abp install-libs` from within the project directory without the -wd flag"],"exampleFix":"// before\nabp install-libs -wd ./wrong/path\n\n// after\nabp install-libs -wd /absolute/path/to/MyProject.Web","handlingStrategy":"validation","validationCode":"// Resolve and validate the working directory before running install-libs\nvar workingDirectory = workingDirectoryArg ?? Directory.GetCurrentDirectory();\nif (!Directory.Exists(workingDirectory))\n{\n    Console.Error.WriteLine($\"Error: Directory does not exist: {workingDirectory}\");\n    return;\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    await installLibsCommand.ExecuteAsync(commandLineArgs);\n}\ncatch (CliUsageException ex) when (ex.Message.Contains(\"Specified directory does not exist\"))\n{\n    logger.LogError(\"The working directory path is invalid. Verify it with: ls <path>\");\n}","preventionTips":["Use absolute paths for the -wd option to avoid context ambiguity","Verify the directory exists before running: test -d /path/to/dir","Run from inside the project directory to avoid needing -wd altogether"],"tags":["cli","abp-cli","missing-argument","filesystem","validation"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}