File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,24 @@ function setup_nodejs() {
5454 echo " deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_VERSION} .x nodistro main" \
5555 > /etc/apt/sources.list.d/nodesource.list
5656
57+ sleep 2
5758 if ! apt-get update > /dev/null 2>&1 ; then
58- msg_error " Failed to update APT repositories after adding NodeSource"
59+ msg_warn " APT update failed – retrying in 5s"
60+ sleep 5
61+ if ! apt-get update > /dev/null 2>&1 ; then
62+ msg_error " Failed to update APT repositories after adding NodeSource"
63+ exit 1
64+ fi
65+ fi
66+
67+ if ! apt-cache policy nodejs | grep -q ' Candidate:' ; then
68+ msg_error " Node.js package not found – repository might be broken or too fresh"
69+ apt-cache policy nodejs >&2
70+ exit 1
71+ fi
72+
73+ if ! apt-get install -y nodejs > /dev/null 2>&1 ; then
74+ msg_error " Failed to install Node.js ${NODE_VERSION} from NodeSource"
5975 exit 1
6076 fi
6177
You can’t perform that action at this time.
0 commit comments