On systems that already have a Node install, leveraging an in-app npm install by Nodelix can raise issues as Npm will lookup PATH to find node. There was a npm flag allowing to provide a custom Node path but it has been removed.
One solution is to do runtime $PATH alteration like this :
def install_deps(project_path) do
npm = Nodelix.VersionManager.bin_path(:npm, get_vsn())
node_dir = Path.dirname(npm)
System.cmd(npm, ["i"],
cd: project_path,
env: [{"PATH", "#{node_dir}:#{System.get_env("PATH")}"}]
)
end
But a more general utility would be nice to have.