Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Webtools releases

## [Unreleased]
### Fixed
- Workaround for a Windows issue afflicting modern node versions.
- Cannot run program "...\build\node-install\node\npm.cmd" ...: CreateProcess error=2, The system cannot find the file specifie

## [1.2.0] - 2025-07-28
### Added
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ apply from: 干.file('base/sonatype.gradle')
dependencies {
// node.js
api 'com.github.eirslett:frontend-maven-plugin:1.15.1'
implementation 'com.diffplug.durian:durian-swt.os:5.0.1'
// static file server
String VER_JETTY = '11.0.25'
api "org.eclipse.jetty:jetty-server:$VER_JETTY"
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/com/diffplug/webtools/node/SetupCleanupNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
*/
package com.diffplug.webtools.node;

import com.diffplug.common.swt.os.OS;
import com.github.eirslett.maven.plugins.frontend.lib.FrontendPluginFactory;
import com.github.eirslett.maven.plugins.frontend.lib.InstallationException;
import com.github.eirslett.maven.plugins.frontend.lib.ProxyConfig;
import com.github.eirslett.maven.plugins.frontend.lib.TaskRunnerException;
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.nio.file.Files;
import java.util.Collections;
Expand Down Expand Up @@ -55,6 +57,15 @@ protected void doStart(SetupCleanupNode key) throws TaskRunnerException, Install
.setNodeVersion(key.nodeVersion)
.setNpmVersion(key.npmVersion)
.install();
if (OS.getNative().isWindows()) {
// copy npm.cmd as a windows workaround
try {
Files.copy(key.installDir.toPath().resolve("node/node_modules/npm/bin/npm.cmd"),
key.installDir.toPath().resolve("node/npm.cmd"));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
factory.getNpmRunner(proxyConfig, null)
.execute("ci", null);
}
Expand Down
Loading