summaryrefslogtreecommitdiff
path: root/cli/npm
diff options
context:
space:
mode:
authorNathan Whitaker <17734409+nathanwhit@users.noreply.github.com>2024-07-24 16:37:13 -0700
committerGitHub <noreply@github.com>2024-07-24 23:37:13 +0000
commit795ed23b356dc044cfb497a6189d588604a6c335 (patch)
treeb1e53bac1b69cab4ff0f3da181426bbf024be457 /cli/npm
parent1fad6eb2acc993714fad9d333f409495f5b3d6db (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/npm')
-rw-r--r--cli/npm/byonm.rs7
1 files changed, 6 insertions, 1 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"
+ }
);
}