Skip to content

Commit ff01e71

Browse files
aaajiaoclaude
andcommitted
fix: use apt --reinstall to restore missing npm/corepack binaries
NodeSource nodejs package registers /usr/bin/npm and /usr/bin/corepack in dpkg but the actual files are missing from the filesystem. Plain apt install -y says "already newest version" and does nothing. Use --reinstall to force dpkg to unpack all files again. Also removed unnecessary NodeSource setup_22.x re-run — the repo is already configured, only the binaries need restoring. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9628ad6 commit ff01e71

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

openclaw-orbstack-setup.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -630,13 +630,12 @@ LATEST_TAG=\$(orb -m $VM_NAME bash -lc "cd ~/openclaw && git describe --tags \\\
630630
echo " -> \$LATEST_TAG"
631631
orb -m $VM_NAME bash -lc "cd ~/openclaw && git checkout '\$LATEST_TAG'"
632632
633-
# Ensure pnpm is available (npm/corepack may be missing after apt upgrade)
633+
# Ensure pnpm is available (npm/corepack may vanish after apt upgrade)
634634
orb -m $VM_NAME bash -lc '
635635
if ! command -v pnpm &>/dev/null; then
636636
if ! command -v npm &>/dev/null; then
637-
echo " npm missing, reinstalling Node.js from NodeSource..."
638-
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
639-
sudo apt-get install -y nodejs
637+
echo " npm missing, reinstalling Node.js package..."
638+
sudo apt-get install --reinstall -y nodejs
640639
fi
641640
sudo corepack enable 2>/dev/null || sudo npm install -g pnpm
642641
fi

scripts/refresh-mac-commands.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,12 @@ LATEST_TAG=\$(orb -m $VM_NAME bash -lc "cd ~/openclaw && git describe --tags \\\
225225
echo " -> \$LATEST_TAG"
226226
orb -m $VM_NAME bash -lc "cd ~/openclaw && git checkout '\$LATEST_TAG'"
227227
228-
# Ensure pnpm is available (npm/corepack may be missing after apt upgrade)
228+
# Ensure pnpm is available (npm/corepack may vanish after apt upgrade)
229229
orb -m $VM_NAME bash -lc '
230230
if ! command -v pnpm &>/dev/null; then
231231
if ! command -v npm &>/dev/null; then
232-
echo " npm missing, reinstalling Node.js from NodeSource..."
233-
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
234-
sudo apt-get install -y nodejs
232+
echo " npm missing, reinstalling Node.js package..."
233+
sudo apt-get install --reinstall -y nodejs
235234
fi
236235
sudo corepack enable 2>/dev/null || sudo npm install -g pnpm
237236
fi

0 commit comments

Comments
 (0)