{"record":{"id":"b94cdc8009b01347","repo":"denoland/deno","slug":"the-hoisted-node-modules-linker-requires-node-mo","errorCode":null,"errorMessage":"The hoisted node_modules linker requires --node-modules-dir=manual. Add \"nodeModulesDir\": \"manual\" to your deno.json or pass --node-modules-dir=manual on the command line.","messagePattern":"The hoisted node_modules linker requires --node-modules-dir=manual\\. Add \"nodeModulesDir\": \"manual\" to your deno\\.json or pass --node-modules-dir=manual on the command line\\.","errorType":"validation","errorClass":"AnyError","httpStatus":null,"severity":"error","filePath":"libs/resolver/factory.rs","lineNumber":430,"sourceCode":"      .node_modules_linker_mode\n      .get_or_try_init(|| {\n        if let Some(process_state) = &self.options.npm_process_state\n          && let Some(mode) = process_state.linker_mode\n        {\n          return Ok(mode);\n        }\n        let mode = if let Some(flag) = self.options.node_modules_linker {\n          flag\n        } else {\n          let workspace = &self.workspace_directory()?.workspace;\n          workspace\n            .node_modules_linker()?\n            .unwrap_or_default()\n        };\n        if mode == NodeModulesLinkerMode::Hoisted {\n          let dir_mode = self.raw_node_modules_dir_mode()?;\n          if dir_mode != NodeModulesDirMode::Manual {\n            bail!(\n              \"The hoisted node_modules linker requires --node-modules-dir=manual. \\\n               Add \\\"nodeModulesDir\\\": \\\"manual\\\" to your deno.json or pass \\\n               --node-modules-dir=manual on the command line.\"\n            );\n          }\n        }\n        Ok(mode)\n      })\n      .copied()\n  }\n\n  /// Resolves the path to use for a local node_modules folder.\n  pub fn node_modules_dir_path(&self) -> Result<Option<&Path>, anyhow::Error> {\n    fn resolve_from_root(root_folder: &FolderConfigs, cwd: &Path) -> PathBuf {\n      root_folder\n        .deno_json\n        .as_ref()\n        .map(|c| Cow::Owned(c.dir_path()))","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/libs/resolver/factory.rs#L412-L448","documentation":"Error \"The hoisted node_modules linker requires --node-modules-dir=manual. Add \"nodeModulesDir\": \"manual\" to your deno.json or pass --node-modules-dir=manual on the command line.\" thrown in denoland/deno.","triggerScenarios":"Thrown at libs/resolver/factory.rs:430 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}