summaryrefslogtreecommitdiff
path: root/cli/graph_util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/graph_util.rs')
-rw-r--r--cli/graph_util.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/cli/graph_util.rs b/cli/graph_util.rs
index 53d06071c..90c4f8b38 100644
--- a/cli/graph_util.rs
+++ b/cli/graph_util.rs
@@ -296,6 +296,12 @@ impl ModuleGraphBuilder {
loader: &mut dyn deno_graph::source::Loader,
options: deno_graph::BuildOptions<'a>,
) -> Result<(), AnyError> {
+ // ensure an "npm install" is done if the user has explicitly
+ // opted into using a node_modules directory
+ if self.options.node_modules_dir_enablement() == Some(true) {
+ self.resolver.force_top_level_package_json_install().await?;
+ }
+
graph.build(roots, loader, options).await;
// ensure that the top level package.json is installed if a