Skip to content

pnpm install causes crash #4458

Closed as not planned
Closed as not planned

Description

@agladysh

Description

$ opencode
/home/agladysh/. local/share/pnpm/global/5/-pnpm/[email protected]/node_modules/opencode-linux-ar
m64/bin/opencode: 1
ELF
SyntaxError: Invalid or unexpected token
at wrapSafe (node: internal/modules/cjs/loader: 1378:20)
at Module._compile (node: internal/modules/cjs/loader: 1428:41)
at Module,_extensions..js (node: internal/modules/cjs/loader: 1548:10)
at Module. load (node: internal/modules/cjs/loader: 1288:32) at Module._load (node: internal/modules/cjs/loader:1104:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:173:12)
at node: internal/main/run_main_module: 28:49
Node-js v20.18.1
$ uname -a
Linux THAI-1 6.17.4-orbstack-00308-g195e9689a04f #1 SMP PREEMPT Fri Oct 24
64 aarch64 GNU/Linux
07:22:34 UTC 2025 aarch64 aarch
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:
Ubuntu
25.04
Release:
25.04
Codename:
plucky
$ pnpm --version
10.20.0

OpenCode version

1.0.72

Steps to reproduce

  1. Install Ubuntu 25.04 server VM (Host is OS X 15.6, OrbStack 2.0.4), install nodejs, npm, pnpm via npm.
  2. pnpm i -g opencode-ai
  3. pnpm approve-builds -g, select and approve opencode
  4. Launching opencode leads to crash

Screenshot and/or share link

No response

Operating System

Ubuntu 25.04 (VM in the OS X 15.6 host)

Terminal

Stock OS X Terminal.app

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 18, 2025
  2. self-assigned this
    on Nov 18, 2025
  3. rekram1-node commented on Nov 18, 2025

    @rekram1-node
    Collaborator

    hmm ill check it out

  4. wgumenyuk commented on Nov 25, 2025

    @wgumenyuk

    The issue appears to stem from the entrypoint shell script attempting to run a binary with Node.js. As a workaround, I modified lines 18 and 20 of ~/.local/share/pnpm/opencode, removing node from the command and running the binary directly.

    Interestingly, reinstalling with pnpm worked without the need to modify the shell script (OpenCode version 1.0.110).

  5. bartschuller commented on Nov 30, 2025

    @bartschuller

    Same here on MacOS and pnpm. opencode 1.0.122. These lines aren't right:

    if [ -x "$basedir/node" ]; then
      exec "$basedir/node"  "$basedir/global/5/.pnpm/[email protected]/node_modules/opencode-ai/bin/opencode" "$@"
    else
      exec node  "$basedir/global/5/.pnpm/[email protected]/node_modules/opencode-ai/bin/opencode" "$@"
    fi
  6. changed the title [-]Crash on start on Ubuntu[/-] [+]pnpm install causes crash[/+] on Nov 30, 2025
  7. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 30, 2025
  8. yokodev commented on Dec 9, 2025

    @yokodev

    Another one here, In my case was that it was deleted from the system I couldn't find opencode
    then I reinstalled it like @wgumenyuk did but it didn't work... and run into the same problem
    it seems the script is trying to call a binary hence the ELF error
    so we need to test for ELF or JS and exec accordingly

    so by removing **node ** from this line (20)

    if [ -x "$basedir/node" ]; then
      exec "$basedir/node" "$basedir/global/5/.pnpm/[email protected]/node_modules/opencode-ai/bin/opencode" "$@"
    else
      **exec node  "$basedir/global/5/.pnpm/[email protected]/node_modules/opencode-ai/bin/opencode" "$@"**
    fi

    and just using

    if [ -x "$basedir/node" ]; then
      exec "$basedir/node" "$basedir/global/5/.pnpm/[email protected]/node_modules/opencode-ai/bin/opencode" "$@"
    else
      **exec "$basedir/global/5/.pnpm/[email protected]/node_modules/opencode-ai/bin/opencode" "$@"**
    fi
  9. eyebrowkang commented on Jan 7, 2026

    @eyebrowkang

    same problem with opencode-ai 1.1.4

    /home/xx/.local/share/pnpm/global/5/.pnpm/[email protected]/node_modules/opencode-linux-x64/bin/opencode:1
    ELF
    ^
    
    SyntaxError: Invalid or unexpected token
        at wrapSafe (node:internal/modules/cjs/loader:1638:18)
        at Module._compile (node:internal/modules/cjs/loader:1680:20)
        at Object..js (node:internal/modules/cjs/loader:1839:10)
        at Module.load (node:internal/modules/cjs/loader:1441:32)
        at Function._load (node:internal/modules/cjs/loader:1263:12)
        at TracingChannel.traceSync (node:diagnostics_channel:328:14)
        at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
        at node:internal/main/run_main_module:36:49
    
    Node.js v22.21.1
    ``
    
  10. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  11. removed
    bugSomething isn't working
    on May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions