From 5672ad6e6f9eb88a945dba7e301aecf1972fe67f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Thu, 26 Jun 2025 17:01:42 +0200 Subject: [PATCH] Update tools.func --- misc/tools.func | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/misc/tools.func b/misc/tools.func index 1edb9505a..8529e2c17 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -74,6 +74,15 @@ function setup_nodejs() { fi export NODE_OPTIONS="--max-old-space-size=4096" + +# Ensure valid working directory for npm (avoids uv_cwd error) + if [[ ! -d /opt ]]; then + mkdir -p /opt + fi + cd /opt || {Add commentMore actions + msg_error "Failed to set safe working directory before npm install" + exit 1 + } # Install global Node modules if [[ -n "$NODE_MODULE" ]]; then