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
This commit is contained in:
Nathan Whitaker 2024-07-24 16:37:13 -07:00 committed by GitHub
parent 1fad6eb2ac
commit 795ed23b35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 87 additions and 156 deletions

View file

@ -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"
}
);
}