#Cannot update to main

1 messages · Page 1 of 1 (latest)

hexed timber
#

ping@bashbitch:~$ openclaw update --tag main
Updating OpenClaw...

│
â—‡ âś— Updating via package manager (60.27s)
npm error code ENOENT
npm error syscall spawn /bin/sh
npm error path /home/ping/.npm-global/lib/node_modules/.openclaw-update-stage-EzO24o/lib/node_modules/openclaw/node_modules/@google/genai
npm error errno -2
npm error enoent spawn /bin/sh ENOENT
npm error enoent This is related to npm not being able to find a file.
npm error enoent
npm error A complete log of this run can be found in: /home/ping/.npm/_logs/2026-05-11T10_31_19_290Z-debug-0.log
│
â—‡ Canceled

arctic kelpBOT
#

This one looks less like OpenClaw logic failing and more like npm can’t run lifecycle scripts because /bin/sh is missing/broken:

npm error syscall spawn /bin/sh
npm error enoent spawn /bin/sh ENOENT

Can you paste:

openclaw --version
ls -l /bin/sh
/bin/sh -c 'echo sh-ok'
npm config get script-shell
node -p 'process.execPath + " " + process.version'
#

If /bin/sh -c ... fails, fix that first — on Debian/Ubuntu it’s usually the dash package / /bin/sh -> dash symlink, e.g. reinstalling dash or recreating the symlink. Once /bin/sh works, rerun:

openclaw update --tag main

Docs reference for the updater’s staged npm install path: https://docs.openclaw.ai/cli/update

hexed timber
#

ping@bashbitch:~$ openclaw --version
ls -l /bin/sh
/bin/sh -c 'echo sh-ok'
npm config get script-shell
node -p 'process.execPath + " " + process.version'
OpenClaw 2026.5.10-beta.2 (8287402)
lrwxrwxrwx 1 root root 4 Mar 31 2024 /bin/sh -> dash
sh-ok
null
/usr/bin/node v22.22.2

arctic kelpBOT
#

Good, that rules out the obvious /bin/sh breakage. Since /bin/sh works, the next most useful clue is npm’s debug log — npm can report spawn /bin/sh ENOENT when the lifecycle script’s cwd disappeared/was invalid too, not only when the shell is missing.

Can you paste these?

npm --version
sed -n '1,220p' /home/ping/.npm/_logs/2026-05-11T10_31_19_290Z-debug-0.log
find /home/ping/.npm-global/lib/node_modules -maxdepth 1 -name '.openclaw-update-stage-*' -print

Also, small note: --tag main is the npm/package-manager path. If the goal is “track the Git main/dev checkout” rather than an npm dist-tag, try this route instead:

openclaw update --channel dev

But I’d still like the npm log — this may be an updater/npm staging edge case around the @google/genai lifecycle script.

hexed timber
arctic kelpBOT
#

Thanks — this confirms openclaw update --tag main is doing a staged npm install of the GitHub branch:

npm i -g --prefix ... github:openclaw/openclaw#main

The paste only has lines 1–220, before the actual stack/error. Can you paste the end too?

tail -n 120 /home/ping/.npm/_logs/2026-05-11T10_31_19_290Z-debug-0.log

You also have a leftover staged install now:

/home/ping/.npm-global/lib/node_modules/.openclaw-update-stage-qKmV8h
#

Don’t delete it yet if you can paste the tail first; it may help identify what npm was doing when it blew up.

Practical workaround meanwhile: for “main/dev” I would use the git checkout flow instead of npm’s GitHub install path:

openclaw update --channel dev

That matches the updater docs for tracking main and avoids this npm lifecycle/staging path. https://docs.openclaw.ai/cli/update

hexed timber
arctic kelpBOT
#

Yep, the tail nails it:

npm i -g --prefix ... github:openclaw/openclaw#main
info run @google/genai ... preinstall echo 'preinstall: no-op'
Error: spawn /bin/sh ENOENT

Since your /bin/sh works normally, this is very likely npm tripping during lifecycle scripts inside the staged GitHub install, not OpenClaw being unable to find the shell globally. The @google/genai script is literally just echo 'preinstall: no-op', so there’s nothing meaningful to build there.

Best path: don’t use --tag main for tracking main. Use the dev/git checkout flow:

openclaw update --channel dev

If you specifically want to keep trying the npm GitHub path, try disabling npm lifecycle scripts for this update:

#
npm_config_ignore_scripts=true openclaw update --tag main
openclaw doctor --fix
openclaw gateway restart

That should bypass the broken preinstall script execution. After you’re successfully updated, you can clean up the leftover .openclaw-update-stage-* dirs under /home/ping/.npm-global/lib/node_modules/ — they’re failed staging directories.

If --channel dev also fails, paste that log; that would be a different path and much more actionable.

hexed timber
arctic kelpBOT
#

Ah — that workaround got past the npm shell bug, but it also explains the new breakage: npm_config_ignore_scripts=true skipped the GitHub package’s build/prepare/postinstall work, so the staged install is incomplete. That’s why you now see missing files like:

dist/install.runtime.js
dist/plugins/loader.js
updated install entrypoint not found

So: don’t keep that install. Recover back to a packaged release first, then use the dev/git updater path.

Try:

npm install -g --prefix /home/ping/.npm-global openclaw@2026.5.10-beta.2
openclaw --version
openclaw doctor --fix
#
openclaw gateway restart

Then, if you want main/dev, use:

openclaw update --channel dev

Not --tag main. --tag main forces npm to install GitHub source as a package, which is exactly the fragile path here. --channel dev is the documented git checkout flow for tracking main: https://docs.openclaw.ai/cli/update

If the reinstall also hits spawn /bin/sh ENOENT, try this one diagnostic/fix before rerunning it:

npm config set script-shell /bin/sh
#
npm install -g --prefix /home/ping/.npm-global openclaw@2026.5.10-beta.2

If that still fails, paste the reinstall log — at that point it’s an npm lifecycle execution issue on that Arch box, not the OpenClaw updater itself.

hexed timber
arctic kelpBOT
#

Nice, the core update succeeded 🎉

The remaining issue is only plugin cleanup/repair:

Plugin install payload missing after update: ... @openclaw/discord
Run openclaw doctor --fix

Run:

openclaw doctor --fix
openclaw plugins inspect discord --runtime --json
openclaw status --all