Skip to content

Isolate the app's Node runtime without creating a global node symlink #596

Closed

Description

@wafe

Problem

I want to use herdr web ui alongside existing nvm-managed projects without changing their Node runtime.

On my Ubuntu 20.04.5 x64 host, the installation had this symlink:

~/.local/bin/node -> ~/.local/share/herdr-web-ui/node/bin/node

The app-managed Node was v22.23.2. Because my shell puts ~/.local/bin before the nvm directory, node resolved to v22.23.2 while npm came from the project's Node v14.17.1 installation. This caused an existing node-sass project to fail during npm install.

Removing the symlink restored the project's Node selection, but exposed another problem: the unpatched Web UI used the Node from the existing Herdr process's PATH, which was v10.24.1. Its PTY sidecar repeatedly exited with "SyntaxError: Unexpected token *". Conversation output kept updating, but the input connection repeatedly closed.

During a manual upgrade to 0.4.0, bun run typecheck also picked Node 10 and failed with "SyntaxError: Unexpected token ?".

The original PTY issue was observed on 0.3.51. I am now running 0.4.0 with a local patch that explicitly selects the app-managed Node for the PTY sidecar. Herdr is 0.9.3 and Bun is 1.4.0.

Related issues:

Proposal

Please keep the app's Node runtime isolated from the user's development environment:

  1. Stop creating ~/.local/bin/node when installing the app-managed Node. Keep that runtime in the app's own directory.

  2. Resolve the Node executable using:

    • An optional explicit override, for example HERDR_WEB_NODE_BIN.
    • The runtime provided by the active remote bundle or app installation.
    • A compatible Node from PATH as a fallback.
  3. Use the same resolved executable for both the sidecar availability check and the actual PTY spawn. Validate that it is Node, not Bun, and meets the project's supported version requirements. An invalid explicit override should produce a clear diagnostic.

  4. Make automatic selection work without any configuration. The override should be optional and supported through the existing plugin env/.env files, without requiring users to edit .bashrc or .zshrc before installation.

  5. Apply the selected Node to app installation/update build subprocesses as well, so tools such as tsc and Vite do not accidentally use an older Node. Keep this environment change scoped to those subprocesses.

Where

Install and updates

Workarounds and alternatives

My current workaround is to:

  • Remove only the symlink pointing to the app-managed Node.
  • Patch server/pty/session.ts to launch ~/.local/share/herdr-web-ui/node/bin/node explicitly.
  • Prepend that Node directory to PATH only for the app's typecheck/build process.

This restored the Web UI and the project's Node selection, but the local source patch blocks the built-in updater and must be maintained across releases.

Hard-coding this path upstream would not cover source installations or remote bundles with different runtime locations. Automatic selection with an optional explicit override would avoid requiring a local patch.

Activity

  1. added
    enhancement
    on Oct 8, 2026
  2. added a commit that references this issue on Oct 28, 2026
    6fdc930
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions