diff --git a/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskRunNpmInstall.java b/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskRunNpmInstall.java index a95fe4d8def..ca6b1b6b333 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskRunNpmInstall.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/frontend/TaskRunNpmInstall.java @@ -32,6 +32,7 @@ import org.apache.commons.io.FileUtils; import org.slf4j.Logger; +import com.vaadin.experimental.FeatureFlags; import com.vaadin.flow.internal.Pair; import com.vaadin.flow.server.Constants; import com.vaadin.flow.server.ExecutionFailedException; @@ -267,6 +268,9 @@ private void runNpmInstall() throws ExecutionFailedException { } npmInstallCommand.add("--ignore-scripts"); + if (options.getFeatureFlags().isEnabled(FeatureFlags.REACT19)) { + npmInstallCommand.add(" --legacy-peer-deps"); + } if (options.isCiBuild()) { if (options.isEnablePnpm() || options.isEnableBun()) {