Class PackageManagerExecutor
java.lang.Object
org.openrewrite.javascript.internal.PackageManagerExecutor
Locates and runs a Node.js package manager CLI (npm, yarn, pnpm, bun).
Pre-configured instances are provided for each;
find() caches the
resolved executable path on first lookup. On Windows the executable is
suffixed with .cmd (matching shell-utils.ts behaviour).-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PackageManagerExecutorstatic final PackageManagerExecutorstatic final PackageManagerExecutorstatic final PackageManagerExecutor -
Method Summary
-
Field Details
-
NPM
-
YARN
-
PNPM
-
BUN
-
-
Method Details
-
run
public PackageManagerExecutor.RunResult run(Path workDir, String executablePath, Map<String, String> environment, String... args) throws IOException, InterruptedExceptionRun the package manager in the given directory.- Throws:
IOExceptionInterruptedException
-
find
Find the executable on the system, returningnullif not installed. Searches standard install locations first, then falls back towhich <name>.
-