From 8f52bbc60d836b877e04f736f95be87f51a7c61d Mon Sep 17 00:00:00 2001 From: AdemZarrouki Date: Thu, 7 May 2026 12:13:02 +0200 Subject: [PATCH 1/2] #1886: update NpmBasedCommandlet to correctly detect installed tool version --- .../tools/ide/tool/npm/NpmBasedCommandlet.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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..b96d3049d5 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 @@ -1,6 +1,7 @@ package com.devonfw.tools.ide.tool.npm; import java.nio.file.Files; +import java.nio.file.Path; import java.util.List; import java.util.Set; @@ -50,6 +51,17 @@ public ToolRepository getToolRepository() { return this.context.getNpmRepository(); } + /** + * Override to ignore the toolPath parameter and use npm package manager to detect the actual installed version of the tool. + * + * @param toolPath the installation {@link Path} where to find the version file. + * @return the installed version or null if not installed. + */ + @Override + protected VersionIdentifier getInstalledVersion(Path toolPath) { + return computeInstalledVersion(); + } + @Override protected VersionIdentifier computeInstalledVersion() { return runPackageManagerGetInstalledVersion(getPackageName()); From 8446e0ac847152b6f7042ea5d712fca1d336e85b Mon Sep 17 00:00:00 2001 From: AdemZarrouki Date: Thu, 7 May 2026 12:22:43 +0200 Subject: [PATCH 2/2] #1886: update CHANGELOG --- CHANGELOG.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 7c2e2ca190..9621e50d79 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -22,6 +22,7 @@ Release with new features and bugfixes: * https://github.com/devonfw/IDEasy/issues/1723[#1723]: Add commandlet for GitHub Copilot CLI * https://github.com/devonfw/IDEasy/issues/1688[#1688]: Remove unnecessary message in the CLI when installing a new tool * https://github.com/devonfw/IDEasy/issues/1685[#1685]: Add Nest CLI to IDEasy commandlets +* https://github.com/devonfw/IDEasy/issues/1886[#1886]: Fix NpmBasedCommandlet shows wrong tool version after install The full list of changes for this release can be found in https://github.com/devonfw/IDEasy/milestone/44?closed=1[milestone 2026.05.001].