From 7eaf8cfeb439b31a0c9bd35e570f40f4dea9f292 Mon Sep 17 00:00:00 2001 From: AdemZarrouki Date: Tue, 9 Jun 2026 11:37:26 +0200 Subject: [PATCH 1/6] #1965: Add ToolInstallRequest to PackageManagerRequest --- .../tools/ide/tool/PackageManagerRequest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerRequest.java b/cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerRequest.java index 4372bee4f8..50d7159460 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerRequest.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerRequest.java @@ -32,6 +32,8 @@ public final class PackageManagerRequest { private ProcessMode processMode; + private ToolInstallRequest toolInstallRequest; + /** * The constructor. * @@ -166,4 +168,16 @@ public PackageManagerRequest setProcessMode(ProcessMode processMode) { return this; } + public ToolInstallRequest getToolInstallRequest() { + return toolInstallRequest; + } + + public PackageManagerRequest setToolInstallRequest(ToolInstallRequest toolInstallRequest) { + if (this.toolInstallRequest != null) { + throw new IllegalStateException(); + } + this.toolInstallRequest = toolInstallRequest; + return this; + } + } From 0ceba4ce93ecb138ed1ee164299c28af35e33f4b Mon Sep 17 00:00:00 2001 From: AdemZarrouki Date: Tue, 9 Jun 2026 11:40:32 +0200 Subject: [PATCH 2/6] #1965: Add Javadoc for getter and setter of toolInstallRequest --- .../devonfw/tools/ide/tool/PackageManagerRequest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerRequest.java b/cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerRequest.java index 50d7159460..20ed667e8c 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerRequest.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerRequest.java @@ -168,10 +168,17 @@ public PackageManagerRequest setProcessMode(ProcessMode processMode) { return this; } + /** + * @return the optional parent {@link ToolInstallRequest} if this package-manager invocation happens during a tool installation. + */ public ToolInstallRequest getToolInstallRequest() { return toolInstallRequest; } + /** + * @param toolInstallRequest the parent {@link ToolInstallRequest} if this package-manager invocation happens during a tool installation. + * @return this {@link PackageManagerRequest} for fluent API calls. + */ public PackageManagerRequest setToolInstallRequest(ToolInstallRequest toolInstallRequest) { if (this.toolInstallRequest != null) { throw new IllegalStateException(); @@ -179,5 +186,5 @@ public PackageManagerRequest setToolInstallRequest(ToolInstallRequest toolInstal this.toolInstallRequest = toolInstallRequest; return this; } - + } From 25568343224f0b2de340c3d70cfbd583a45d14f2 Mon Sep 17 00:00:00 2001 From: AdemZarrouki Date: Thu, 11 Jun 2026 09:50:18 +0200 Subject: [PATCH 3/6] Revert "#1965: Add Javadoc for getter and setter of toolInstallRequest" This reverts commit 0ceba4ce93ecb138ed1ee164299c28af35e33f4b. --- .../devonfw/tools/ide/tool/PackageManagerRequest.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerRequest.java b/cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerRequest.java index 20ed667e8c..50d7159460 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerRequest.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerRequest.java @@ -168,17 +168,10 @@ public PackageManagerRequest setProcessMode(ProcessMode processMode) { return this; } - /** - * @return the optional parent {@link ToolInstallRequest} if this package-manager invocation happens during a tool installation. - */ public ToolInstallRequest getToolInstallRequest() { return toolInstallRequest; } - /** - * @param toolInstallRequest the parent {@link ToolInstallRequest} if this package-manager invocation happens during a tool installation. - * @return this {@link PackageManagerRequest} for fluent API calls. - */ public PackageManagerRequest setToolInstallRequest(ToolInstallRequest toolInstallRequest) { if (this.toolInstallRequest != null) { throw new IllegalStateException(); @@ -186,5 +179,5 @@ public PackageManagerRequest setToolInstallRequest(ToolInstallRequest toolInstal this.toolInstallRequest = toolInstallRequest; return this; } - + } From bcfcaf9e9e97b9f50c0a854713def6cc2b58d74c Mon Sep 17 00:00:00 2001 From: AdemZarrouki Date: Thu, 11 Jun 2026 09:52:43 +0200 Subject: [PATCH 4/6] Revert "#1965: Add ToolInstallRequest to PackageManagerRequest" This reverts commit 7eaf8cfeb439b31a0c9bd35e570f40f4dea9f292. --- .../tools/ide/tool/PackageManagerRequest.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerRequest.java b/cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerRequest.java index 50d7159460..4372bee4f8 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerRequest.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerRequest.java @@ -32,8 +32,6 @@ public final class PackageManagerRequest { private ProcessMode processMode; - private ToolInstallRequest toolInstallRequest; - /** * The constructor. * @@ -168,16 +166,4 @@ public PackageManagerRequest setProcessMode(ProcessMode processMode) { return this; } - public ToolInstallRequest getToolInstallRequest() { - return toolInstallRequest; - } - - public PackageManagerRequest setToolInstallRequest(ToolInstallRequest toolInstallRequest) { - if (this.toolInstallRequest != null) { - throw new IllegalStateException(); - } - this.toolInstallRequest = toolInstallRequest; - return this; - } - } From 14bd74e55af0ded56ae4089a0b539f6a8260aa01 Mon Sep 17 00:00:00 2001 From: AdemZarrouki Date: Thu, 11 Jun 2026 12:19:32 +0200 Subject: [PATCH 5/6] #1965: fix redundant call of npm and node when installing npm based commandlet --- .../devonfw/tools/ide/tool/npm/NpmBasedCommandlet.java | 8 +++++++- .../devonfw/tools/ide/tool/pip/PipBasedCommandlet.java | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/npm/NpmBasedCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/tool/npm/NpmBasedCommandlet.java index 93eeb39768..afe80bcddb 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/npm/NpmBasedCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/npm/NpmBasedCommandlet.java @@ -65,7 +65,7 @@ private VersionIdentifier runPackageManagerGetInstalledVersion(String npmPackage ProcessContext pc = this.context.newProcess().errorHandling(ProcessErrorHandling.THROW_CLI) .withExitCodeAcceptor(rc -> true); // if the tool is not installed npm list will end with exit code 1 request.setProcessContext(pc); - ProcessResult result = runPackageManager(request); + ProcessResult result = runPackageManager(request, true); if (result.isSuccessful()) { List versions = result.getOut(); String parsedVersion = null; @@ -84,4 +84,10 @@ private VersionIdentifier runPackageManagerGetInstalledVersion(String npmPackage return null; } + @Override + protected boolean isSkipInstallation() { + Npm npm = this.context.getCommandletManager().getCommandlet(Npm.class); + return npm.isInstalled(); + } + } diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/pip/PipBasedCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/tool/pip/PipBasedCommandlet.java index b94a4124d0..e096c43ef0 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/pip/PipBasedCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/pip/PipBasedCommandlet.java @@ -110,7 +110,7 @@ protected VersionIdentifier computeInstalledVersion() { } PackageManagerRequest request = new PackageManagerRequest("show", getPackageName()).setProcessMode(ProcessMode.DEFAULT_CAPTURE) .setProcessContext(this.context.newProcess().errorHandling(ProcessErrorHandling.NONE)); - ProcessResult processResult = runPackageManager(request); + ProcessResult processResult = runPackageManager(request, true); if (processResult.isSuccessful()) { for (String line : processResult.getOut()) { // we are looking for something like "Version: 25.3" From 1c2bfa0808f69b71b22e047361267c6ca20b518f Mon Sep 17 00:00:00 2001 From: AdemZarrouki Date: Fri, 12 Jun 2026 09:26:32 +0200 Subject: [PATCH 6/6] #1965: update changelog --- CHANGELOG.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 53a168492d..ede1f8bff7 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -15,6 +15,7 @@ Release with new features and bugfixes: * https://github.com/devonfw/IDEasy/issues/1849[#1849]: Add VSCodium support * https://github.com/devonfw/IDEasy/issues/1391[#1391]: Fix bashrc messed with terraform completions * https://github.com/devonfw/IDEasy/issues/1922[#1922]: Add Task CLI to IDEasy commandlets +* https://github.com/devonfw/IDEasy/issues/1965[#1965]: Improve dependent installations for npm and pip based commandlets The full list of changes for this release can be found in https://github.com/devonfw/IDEasy/milestone/45?closed=1[milestone 2026.06.001].