Skip to content

Commit

Permalink
fix: replace npm install hint with deno install hint (#25244)
Browse files Browse the repository at this point in the history
Needed for #25213.

With Deno 2, we should suggest using `deno install` instead of `npm
install`.
  • Loading branch information
bartlomieju committed Aug 28, 2024
1 parent 1a6fd38 commit 3dba985
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
7 changes: 1 addition & 6 deletions cli/npm/byonm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,9 @@ 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 `{}`?"
"Did you forget to run `deno install`?"
),
alias,
if *crate::args::DENO_FUTURE {
"deno install"
} else {
"npm install"
}
);
}

Expand Down
2 changes: 1 addition & 1 deletion cli/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl CliNodeResolver {
concat!(
"Could not resolve \"{}\", but found it in a package.json. ",
"Deno expects the node_modules/ directory to be up to date. ",
"Did you forget to run `npm install`?"
"Did you forget to run `deno install`?"
),
specifier
));
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/npm_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2404,7 +2404,7 @@ fn byonm_package_specifier_not_installed_and_invalid_subpath() {
// no npm install has been run, so this should give an informative error
let output = test_context.new_command().args("run main.ts").run();
output.assert_matches_text(
r#"error: Could not resolve "chalk", but found it in a package.json. Deno expects the node_modules/ directory to be up to date. Did you forget to run `npm install`?
r#"error: Could not resolve "chalk", but found it in a package.json. Deno expects the node_modules/ directory to be up to date. Did you forget to run `deno install`?
at file:///[WILDCARD]/main.ts:1:19
"#,
);
Expand Down
2 changes: 1 addition & 1 deletion tests/specs/npm/byonm/not_installed.out
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
error: Could not find "chalk" in a node_modules folder. Deno expects the node_modules/ directory to be up to date. Did you forget to run `npm install`?
error: Could not find "chalk" in a node_modules folder. Deno expects the node_modules/ directory to be up to date. Did you forget to run `deno install`?
at file:///[WILDCARD]/not_installed.ts:1:19

0 comments on commit 3dba985

Please sign in to comment.