diff options
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/npm/byonm.rs | 7 | ||||
| -rw-r--r-- | cli/resolver.rs | 9 | ||||
| -rw-r--r-- | cli/tools/installer.rs | 8 |
3 files changed, 17 insertions, 7 deletions
diff --git a/cli/npm/byonm.rs b/cli/npm/byonm.rs index d10bb6b2a..86c9badac 100644 --- a/cli/npm/byonm.rs +++ b/cli/npm/byonm.rs @@ -286,9 +286,14 @@ impl CliNpmResolver for ByonmCliNpmResolver { concat!( "Could not find \"{}\" in a node_modules folder. ", "Deno expects the node_modules/ directory to be up to date. ", - "Did you forget to run `npm install`?" + "Did you forget to run `{}`?" ), alias, + if *crate::args::DENO_FUTURE { + "deno install" + } else { + "npm install" + } ); } diff --git a/cli/resolver.rs b/cli/resolver.rs index c1bb8a0a5..c9940b406 100644 --- a/cli/resolver.rs +++ b/cli/resolver.rs @@ -233,8 +233,13 @@ impl CliNodeResolver { let package_json_path = package_folder.join("package.json"); if !self.fs.exists_sync(&package_json_path) { return Err(anyhow!( - "Could not find '{}'. Deno expects the node_modules/ directory to be up to date. Did you forget to run `npm install`?", - package_json_path.display() + "Could not find '{}'. Deno expects the node_modules/ directory to be up to date. Did you forget to run `{}`?", + package_json_path.display(), + if *crate::args::DENO_FUTURE { + "deno install" + } else { + "npm install" + }, )); } } diff --git a/cli/tools/installer.rs b/cli/tools/installer.rs index 01ed36711..d1beb79bb 100644 --- a/cli/tools/installer.rs +++ b/cli/tools/installer.rs @@ -283,12 +283,12 @@ pub async fn install_command( flags: Arc<Flags>, install_flags: InstallFlags, ) -> Result<(), AnyError> { - if !install_flags.global { - log::warn!("⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag."); - } - match install_flags.kind { InstallKind::Global(global_flags) => { + if !install_flags.global { + log::warn!("⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use the `-g` or `--global` flag."); + } + install_global(flags, global_flags).await } InstallKind::Local(maybe_add_flags) => { |
