Skip to content

fix(install.sh): install moshcode's runtime dependencies after unpacking - #505

Merged
ralyodio merged 1 commit into
mainfrom
fix/installer-runtime-deps
Sep 13, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/installer-runtime-deps

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

What

moshcode stopped being dependency-free in 0.96.0 (@profullstack/synconfig). install.sh unpacks the source tarball and stops, and moshcode upgrade runs this script from main, so every install and upgrade through it since 0.96.0 produced a CLI that died on its first import:

Cannot find package '@profullstack/synconfig' imported from ~/.moshcode/pkg/src/settings-sync.mjs

Seen on this box right after upgrading to 0.98.0: moshcode --version crashed.

Fix

After the package is in place, read package.json with node (grep would match "devDependencies" too) and, when it lists runtime dependencies, run npm install --omit=dev in MOSHCODE_HOME. A missing npm or a failed install fails the install loudly instead of leaving a CLI that cannot start.

Because moshcode upgrade fetches install.sh from raw main, merging this repairs the upgrade path for everyone immediately; no version bump is needed. The moshcoding.com installer has the same bug and the same fix in moshcoder/moshcoding#116.

Verified

  • test/install-deps.test.mjs drives the real install.sh against a tarball built in the test, with curl serving the fixture and npm recording its argv and cwd: dependencies → npm install --omit=dev runs in the install dir; devDependencies only → npm never called; npm fails → the install fails and says why.
  • sh -n install.sh clean; root-guard and upgrade suites still pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_014HMV1QDcVY1xiaWWrZQM4S

moshcode stopped being dependency-free in 0.96.0 (@profullstack/synconfig),
and install.sh unpacks the source tarball and stops, so every install and
every `moshcode upgrade` (which runs this script from main) since then
produced a CLI that died on its first import:

  Cannot find package '@profullstack/synconfig' imported from
  ~/.moshcode/pkg/src/settings-sync.mjs

Seen on this box after upgrading to 0.98.0: `moshcode --version` crashed.

After the package is in place, read package.json with node (grep would
match "devDependencies" too) and, when it lists runtime dependencies, run
`npm install --omit=dev` in MOSHCODE_HOME. A missing npm or a failed install
fails the install loudly rather than leaving a CLI that cannot start.

test/install-deps.test.mjs drives the real install.sh against a tarball
built in the test, with curl serving the fixture and npm recording its argv
and cwd: dependencies → npm runs in the install dir; devDependencies only →
npm is never called; npm fails → the install fails and says why.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014HMV1QDcVY1xiaWWrZQM4S
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

5 finding(s) in the 2 file(s) this pull request changes.

HIGH/CRITICAL: 5

Severity Rule Location
HIGH sh-remote-script-execution install.sh:86
HIGH sh-remote-script-execution install.sh:90
HIGH sh-remote-script-execution install.sh:227
HIGH sh-remote-script-execution install.sh:238
HIGH sh-remote-script-execution install.sh:244
88 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 3 | **MEDIUM**: 75 | **LOW**: 10

Not introduced by this pull request. The full set is in the Security tab.

Severity Rule Location
HIGH js-ssrf-outbound-request apps/pwa/public/sw.js:45
HIGH tls-verification-disabled apps/pwa/src/lib/moshpit-gateway.mjs:299
HIGH tls-verification-disabled src/dns.mjs:766
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:139
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:153
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:179
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:373
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:377
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:422
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:671
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:867
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:869
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:928
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:974
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1044
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1147
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1170
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1192
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1391
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:1541

…and 68 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 426bf70 into main Sep 13, 2026
6 checks passed
@ralyodio
ralyodio deleted the fix/installer-runtime-deps branch September 13, 2026 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant