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.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/graph_util.rs b/cli/graph_util.rs
index 8ea48702a..df4e5132d 100644
--- a/cli/graph_util.rs
+++ b/cli/graph_util.rs
@@ -187,6 +187,7 @@ pub async fn create_graph_and_maybe_check(
let mut graph = ModuleGraph::default();
build_graph_with_npm_resolution(
&mut graph,
+ &cli_resolver,
&ps.npm_resolver,
roots,
&mut cache,
@@ -249,6 +250,7 @@ pub async fn create_graph_and_maybe_check(
pub async fn build_graph_with_npm_resolution<'a>(
graph: &mut ModuleGraph,
+ cli_graph_resolver: &CliGraphResolver,
npm_resolver: &NpmPackageResolver,
roots: Vec<ModuleSpecifier>,
loader: &mut dyn deno_graph::source::Loader,
@@ -256,6 +258,12 @@ pub async fn build_graph_with_npm_resolution<'a>(
) -> Result<(), AnyError> {
graph.build(roots, loader, options).await;
+ // ensure that the top level package.json is installed if a
+ // specifier was matched in the package.json
+ cli_graph_resolver
+ .top_level_package_json_install_if_necessary()
+ .await?;
+
// resolve the dependencies of any pending dependencies
// that were inserted by building the graph
npm_resolver.resolve_pending().await?;