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

devonfw / IDEasy / 18699731973

21 Oct 2025 10:41PM UTC coverage: 68.537% (+0.002%) from 68.535%
18699731973

push

github

web-flow
#1514: Fixed npm prefix not set (#1539)

Co-authored-by: Jörg Hohwiller <hohwille@users.noreply.github.com>

3469 of 5543 branches covered (62.58%)

Branch coverage included in aggregate %.

9065 of 12745 relevant lines covered (71.13%)

3.13 hits per line

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

76.92
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 com.devonfw.tools.ide.common.Tag;
6
import com.devonfw.tools.ide.context.IdeContext;
7
import com.devonfw.tools.ide.nls.NlsBundle;
8
import com.devonfw.tools.ide.process.ProcessResult;
9
import com.devonfw.tools.ide.tool.LocalToolCommandlet;
10
import com.devonfw.tools.ide.tool.ToolCommandlet;
11
import com.devonfw.tools.ide.tool.npm.Npm;
12

13
/**
14
 * {@link ToolCommandlet} for <a href="https://nodejs.org/">node</a>.
15
 */
16
public class Node extends LocalToolCommandlet {
17

18
  /**
19
   * The constructor.
20
   *
21
   * @param context the {@link IdeContext}.
22
   */
23
  public Node(IdeContext context) {
24

25
    super(context, "node", Set.of(Tag.JAVA_SCRIPT, Tag.RUNTIME));
7✔
26
  }
1✔
27

28
  @Override
29
  protected void postInstall() {
30
    super.postInstall();
2✔
31
    Npm npm = this.context.getCommandletManager().getCommandlet(Npm.class);
7✔
32
    ProcessResult result = npm.runPackageManager("config", "set", "prefix", getToolPath().toString());
23✔
33
    if (result.isSuccessful()) {
3!
34
      this.context.success("Setting npm config prefix to: {} was successful", getToolPath());
11✔
35
    }
36
  }
1✔
37

38
  @Override
39
  public void printHelp(NlsBundle bundle) {
40

41
    this.context.info("For a list of supported options and arguments, use \"node --help\"");
×
42
  }
×
43

44
  @Override
45
  protected boolean isIgnoreSoftwareRepo() {
46

47
    return true;
2✔
48
  }
49
}
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

© 2025 Coveralls, Inc