Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use nodejs path list #19

Merged
merged 11 commits into from
Jan 30, 2025
Merged
12 changes: 10 additions & 2 deletions src/setup_build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ const npm = !Sys.iswindows() ? NodeJS_20_jll.npm : let
isfile(new) ? new : NodeJS_20_jll.npm
end

const npm_cmd = let
# Add NodeJS PATH to the existing PATH environment variable
path_sep = Sys.iswindows() ? ';' : ':'
path_list = prepend!(split(get(ENV, "PATH", ""), path_sep), NodeJS_20_jll.PATH_list)
path = join(path_list, path_sep)
addenv(`$(npm)`, "PATH" => path)
end

function get_build_dir()
build_node(@get_scratch!("build_dir3"))
end
Expand All @@ -29,8 +37,8 @@ function build_node(dir)
end

cd(dir) do
run(`$npm --version`)
run(`$npm install`)
run(`$npm_cmd --version`)
run(`$npm_cmd install`)
end

dir
Expand Down
Loading