diff --git a/R/node.R b/R/node.R index 7293b3c..f359e7f 100644 --- a/R/node.R +++ b/R/node.R @@ -74,7 +74,8 @@ install_flowr <- function(flowr_ver, verbose = FALSE, base_dir = get_default_nod #' @export exec_flowr <- function(args, verbose = FALSE, base_dir = get_default_node_base_dir(), background = FALSE) { # we installed flowr globally (see above) in the scope of our local node installation, so we can find it here - flowr_path <- file.path(get_node_exe_dir(base_dir), "node_modules", "@eagleoutice", "flowr", "cli", "flowr.js") + node_modules <- if (get_os() == "win") "node_modules" else file.path("lib", "node_modules") + flowr_path <- file.path(get_node_exe_dir(base_dir), node_modules, "@eagleoutice", "flowr", "cli", "flowr.js") exec_node_command("node", c(flowr_path, args), verbose, base_dir, background) } diff --git a/tests/testthat/test-node.R b/tests/testthat/test-node.R index 19c60d1..b2a8aae 100644 --- a/tests/testthat/test-node.R +++ b/tests/testthat/test-node.R @@ -3,8 +3,8 @@ test_that("find package directory", { }) test_that("install node", { options(timeout = 300) - expect_no_error(install_node("22.5.1")) + expect_no_error(install_node("22.9.0", TRUE)) }) test_that("install flowr", { - expect_equal(install_flowr("2.0.11"), 0) + expect_equal(install_flowr("2.0.11", TRUE), 0) })