summaryrefslogtreecommitdiff
path: root/cli/tools/task.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/task.rs')
-rw-r--r--cli/tools/task.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/cli/tools/task.rs b/cli/tools/task.rs
index ffeea7460..dfb0c585e 100644
--- a/cli/tools/task.rs
+++ b/cli/tools/task.rs
@@ -88,10 +88,13 @@ pub async fn execute_script(
}
}
- // install the npm packages if we're using a managed resolver
- if let Some(npm_resolver) = npm_resolver.as_managed() {
- npm_resolver.ensure_top_level_package_json_install().await?;
- npm_resolver.resolve_pending().await?;
+ // ensure the npm packages are installed if using a node_modules
+ // directory and managed resolver
+ if cli_options.has_node_modules_dir() {
+ if let Some(npm_resolver) = npm_resolver.as_managed() {
+ npm_resolver.ensure_top_level_package_json_install().await?;
+ npm_resolver.resolve_pending().await?;
+ }
}
let cwd = match task_flags.cwd {