From 67280f8b558902729c805fd3d8f26d4c434fc211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 22 Oct 2024 00:08:45 +0100 Subject: fix(install): update lockfile when using package.json (#26458) This commit makes sure that `deno add`, `deno install` and `deno remove` update the lockfile if only `package.json` file is present. Fixes https://github.com/denoland/deno/issues/26270 --- cli/tools/registry/pm.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cli/tools/registry') diff --git a/cli/tools/registry/pm.rs b/cli/tools/registry/pm.rs index bd5290998..2060b9a13 100644 --- a/cli/tools/registry/pm.rs +++ b/cli/tools/registry/pm.rs @@ -723,6 +723,10 @@ async fn npm_install_after_modification( // npm install cache_deps::cache_top_level_deps(&cli_factory, jsr_resolver).await?; + if let Some(lockfile) = cli_factory.cli_options()?.maybe_lockfile() { + lockfile.write_if_changed()?; + } + Ok(()) } -- cgit v1.2.3