diff options
Diffstat (limited to 'cli/main.rs')
-rw-r--r-- | cli/main.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cli/main.rs b/cli/main.rs index d121d1c92..64c73664c 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -201,7 +201,14 @@ async fn install_command( root: Option<PathBuf>, force: bool, ) -> Result<(), AnyError> { - installer::install(flags, &module_url, args, name, root, force).await + // First, fetch and compile the module; this step ensures that the module exists. + let mut fetch_flags = flags.clone(); + fetch_flags.reload = true; + let global_state = GlobalState::new(fetch_flags)?; + let main_module = ModuleSpecifier::resolve_url_or_path(&module_url)?; + let mut worker = MainWorker::create(&global_state, main_module.clone())?; + worker.preload_module(&main_module).await?; + installer::install(flags, &module_url, args, name, root, force) } async fn lint_command( |