Skip to content

Commit 0a72c81

Browse files
authored
Update tools.func (#5488)
1 parent dfd6124 commit 0a72c81

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

misc/tools.func

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ function setup_nodejs() {
7474
fi
7575

7676
export NODE_OPTIONS="--max-old-space-size=4096"
77+
78+
# Ensure valid working directory for npm (avoids uv_cwd error)
79+
if [[ ! -d /opt ]]; then
80+
mkdir -p /opt
81+
fi
82+
cd /opt || {Add commentMore actions
83+
msg_error "Failed to set safe working directory before npm install"
84+
exit 1
85+
}
7786

7887
# Install global Node modules
7988
if [[ -n "$NODE_MODULE" ]]; then

0 commit comments

Comments
 (0)