{"record":{"id":"2abd99ba2ac324b6","repo":"zed-industries/zed","slug":"prettier-node-modules-dir-does-not-exist-prettie","errorCode":null,"errorMessage":"Prettier node_modules dir does not exist: {prettier_node_modules:?}","messagePattern":"Prettier node_modules dir does not exist: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/prettier/src/prettier.rs","lineNumber":369,"sourceCode":"        buffer_path: Option<PathBuf>,\n        ignore_dir: Option<PathBuf>,\n        range_utf16: Option<Range<OffsetUtf16>>,\n        request_timeout: Duration,\n        cx: &mut AsyncApp,\n    ) -> anyhow::Result<Diff> {\n        match self {\n            Self::Real(local) => {\n                let params = buffer\n                    .update(cx, |buffer, cx| {\n                        let buffer_language = buffer.language().map(|language| language.as_ref());\n                        let language_settings = LanguageSettings::for_buffer(&buffer, cx);\n                        let prettier_settings = &language_settings.prettier;\n                        anyhow::ensure!(\n                            prettier_settings.allowed,\n                            \"Cannot format: prettier is not allowed for language {buffer_language:?}\"\n                        );\n                        let prettier_node_modules = self.prettier_dir().join(\"node_modules\");\n                        anyhow::ensure!(\n                            prettier_node_modules.is_dir(),\n                            \"Prettier node_modules dir does not exist: {prettier_node_modules:?}\"\n                        );\n                        let plugin_name_into_path = |plugin_name: &str| {\n                            let prettier_plugin_dir = prettier_node_modules.join(plugin_name);\n                            [\n                                prettier_plugin_dir.join(\"dist\").join(\"index.mjs\"),\n                                prettier_plugin_dir.join(\"dist\").join(\"index.js\"),\n                                prettier_plugin_dir.join(\"dist\").join(\"plugin.js\"),\n                                prettier_plugin_dir.join(\"src\").join(\"plugin.js\"),\n                                prettier_plugin_dir.join(\"lib\").join(\"index.js\"),\n                                prettier_plugin_dir.join(\"index.mjs\"),\n                                prettier_plugin_dir.join(\"index.js\"),\n                                prettier_plugin_dir.join(\"plugin.js\"),\n                                // this one is for @prettier/plugin-php\n                                prettier_plugin_dir.join(\"standalone.js\"),\n                                // this one is for prettier-plugin-latex\n                                prettier_plugin_dir.join(\"dist\").join(\"prettier-plugin-latex.js\"),","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/prettier/src/prettier.rs#L351-L387","documentation":"During format, the project's prettier node_modules directory (derived from the located prettier installation) does not exist on disk, so the prettier server binary and its plugins cannot be resolved. Dependencies were likely never installed or were removed after location was cached.","triggerScenarios":"Thrown at crates/prettier/src/prettier.rs:369 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run the package manager install (npm/pnpm/yarn/bun install) in the project so node_modules exists","If node_modules was moved or the path style (e.g. pnpm symlinks) confuses resolution, verify the resolved path manually"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}