• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

devonfw / IDEasy / 22241505980

20 Feb 2026 09:16PM UTC coverage: 70.656% (+0.2%) from 70.474%
22241505980

Pull #1710

github

web-flow
Merge 04e4bdacd into 379acdc9d
Pull Request #1710: #404: allow logging via SLF4J

4121 of 6440 branches covered (63.99%)

Branch coverage included in aggregate %.

10704 of 14542 relevant lines covered (73.61%)

3.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.25
cli/src/main/java/com/devonfw/tools/ide/tool/node/Node.java
1
package com.devonfw.tools.ide.tool.node;
2

3
import java.util.Set;
4

5
import org.slf4j.Logger;
6
import org.slf4j.LoggerFactory;
7

8
import com.devonfw.tools.ide.common.Tag;
9
import com.devonfw.tools.ide.context.IdeContext;
10
import com.devonfw.tools.ide.log.IdeLogLevel;
11
import com.devonfw.tools.ide.nls.NlsBundle;
12
import com.devonfw.tools.ide.process.ProcessResult;
13
import com.devonfw.tools.ide.tool.LocalToolCommandlet;
14
import com.devonfw.tools.ide.tool.PackageManagerRequest;
15
import com.devonfw.tools.ide.tool.ToolCommandlet;
16
import com.devonfw.tools.ide.tool.ToolInstallRequest;
17
import com.devonfw.tools.ide.tool.npm.Npm;
18

19
/**
20
 * {@link ToolCommandlet} for <a href="https://nodejs.org/">node</a>.
21
 */
22
public class Node extends LocalToolCommandlet {
23

24
  private static final Logger LOG = LoggerFactory.getLogger(Node.class);
4✔
25

26
  /**
27
   * The constructor.
28
   *
29
   * @param context the {@link IdeContext}.
30
   */
31
  public Node(IdeContext context) {
32

33
    super(context, "node", Set.of(Tag.JAVA_SCRIPT, Tag.RUNTIME));
7✔
34
  }
1✔
35

36
  @Override
37
  protected void postInstallOnNewInstallation(ToolInstallRequest request) {
38

39
    super.postInstallOnNewInstallation(request);
3✔
40
    // this code is slightly dangerous: npm has a dependency to node, while here in node we call npm causing a cyclic dependency
41
    // the problem is that node package already comes with npm so we already have to configure npm properly here
42
    // inside npm we have to guarantee that we will not trigger an installation (again) causing an infinity loop
43
    // we would love to get this clean but node and npm are already flawed forcing us to do such hacks...
44
    Npm npm = this.context.getCommandletManager().getCommandlet(Npm.class);
7✔
45
    PackageManagerRequest packageManagerRequest = new PackageManagerRequest("config", this.tool).addArg("config").addArg("set").addArg("prefix")
13✔
46
        .addArg(getToolPath().toString());
4✔
47
    ProcessResult result = npm.runPackageManager(packageManagerRequest, true);
5✔
48
    if (result.isSuccessful()) {
3!
49
      LOG.info(IdeLogLevel.SUCCESS.getSlf4jMarker(), "Setting npm config prefix to: {} was successful", getToolPath());
7✔
50
    }
51
  }
1✔
52

53
  @Override
54
  public void printHelp(NlsBundle bundle) {
55

56
    LOG.info("For a list of supported options and arguments, use \"node --help\"");
×
57
  }
×
58

59
  @Override
60
  protected boolean isIgnoreSoftwareRepo() {
61

62
    return true;
2✔
63
  }
64
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc