diff options
author | Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> | 2024-07-24 16:37:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-24 23:37:13 +0000 |
commit | 795ed23b356dc044cfb497a6189d588604a6c335 (patch) | |
tree | b1e53bac1b69cab4ff0f3da181426bbf024be457 /cli/resolver.rs | |
parent | 1fad6eb2acc993714fad9d333f409495f5b3d6db (diff) |
fix(future): Emit `deno install` warning less often, suggest `deno install` in error message (#24706)
Two small changes:
- In our BYONM errors, suggest running `deno install` instead of `npm
install` if `DENO_FUTURE` is set
- Only emit warning about `deno install` changes if you do `deno install
<foo>` with deno_future unset
Diffstat (limited to 'cli/resolver.rs')
-rw-r--r-- | cli/resolver.rs | 9 |
1 files changed, 7 insertions, 2 deletions
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" + }, )); } } |