{"record":{"id":"4ca01aea4281e963","repo":"jdx/mise","slug":"local-plugin-source-is-not-a-directory","errorCode":null,"errorMessage":"local plugin source is not a directory: {}","messagePattern":"local plugin source is not a directory: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/plugins/mod.rs","lineNumber":559,"sourceCode":"    match source {\n        PluginSource::Git {\n            url,\n            git_ref: None,\n            subdir: None,\n        } if url == repository => path.is_absolute().then_some(path),\n        _ => None,\n    }\n}\n\npub(crate) fn validate_local_plugin_source(source: &Path, plugin_path: &Path) -> Result<()> {\n    if !source.exists() {\n        bail!(\n            \"local plugin directory does not exist: {}\",\n            display_path(source)\n        );\n    }\n    if !source.is_dir() {\n        bail!(\n            \"local plugin source is not a directory: {}\",\n            display_path(source)\n        );\n    }\n    let resolved_source = file::desymlink_path(source);\n    let resolved_plugin_path = match (plugin_path.parent(), plugin_path.file_name()) {\n        (Some(parent), Some(file_name)) => file::desymlink_path(parent).join(file_name),\n        _ => plugin_path.to_path_buf(),\n    };\n    if resolved_source\n        .ancestors()\n        .any(|path| file::paths_eq(path, &resolved_plugin_path))\n        || resolved_plugin_path\n            .ancestors()\n            .any(|path| file::paths_eq(path, &resolved_source))\n    {\n        bail!(\n            \"local plugin source cannot contain, be, or be inside the plugin install path: {}\",","sourceCodeStart":541,"sourceCodeEnd":577,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/plugins/mod.rs#L541-L577","documentation":"mise's `validate_local_plugin_source` checks a user-supplied local plugin path before installing it. After confirming the path exists, it verifies it is a directory; a plain file (or symlink to a file) is rejected because plugins are expected to be directory trees containing the plugin scripts. The error message includes the offending path via `display_path(source)`.","triggerScenarios":"Calling `mise install <plugin> file:///path/to/a/file` or `mise plugin add <plugin> /path/to/a/file` where the path exists but `source.is_dir()` is false, i.e. a regular file was passed as the local plugin source.","commonSituations":"Typo where the user points at an archive/zip instead of the extracted plugin directory; passing a mise.plugin.toml file rather than its containing directory; a broken symlink situation where the path resolves to a file.","solutions":["Point the install command at the plugin's directory, not a file inside it (e.g. the directory containing bin/ and lib/ scripts).","If the plugin is a tarball or zip, extract it first and pass the extracted directory.","Verify the path with `ls -la <path>` to confirm it is a directory and not a symlink to a file."],"exampleFix":"// before\nmise plugin add nodejs ~/Downloads/vfox-nodejs.tar.gz\n// after\ntar -xzf ~/Downloads/vfox-nodejs.tar.gz -C ~/plugins\nmise plugin add nodejs ~/plugins/vfox-nodejs","handlingStrategy":"validation","validationCode":"const p = Deno.statSync(src);\nif (!p.isDirectory) throw new Error(`${src} must be a plugin directory`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass the extracted plugin directory, never an archive or a file inside it.","Check with `test -d <path>` in shell wrappers before invoking `mise plugin add`."],"tags":["plugin","filesystem","path"],"backgroundTag":"path-is-not-a-directory","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}