Description
Environment
- Platform: Linux (WSL2)
- Distribution: WSL_DISTRO_NAME=opencode
- Node Version: v24.15.0 (installed via nvm at ~/.nvm/versions/node/v24.15.0/bin/node)
- npm Version: v11.12.1
- Shell: bash
Problem
When OpenCode executes bash commands, which node fails and node --version cannot be found, even though nvm is installed.
Environment Variables at Runtime
HOME=/home/user
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib
npm_config_user_agent=npm/undefined node/v24.3.0 linux x64 workspaces/false
Expected
which node should return a valid path
node --version should work
Actual
which node → no output (node not found)
node --version → command fails
- nvm node exists at
/home/hanfengcan/.nvm/versions/node/v24.15.0/bin/node
npm_config_user_agent shows node/v24.3.0 instead of nvm's v24.15.0
Root Cause
The PATH does not include nvm's node bin directory. nvm is not automatically sourced in OpenCode's bash execution context.
Steps to Reproduce
- Install node via nvm in WSL
- Run OpenCode
- Execute any bash command that checks for node
Additional Context
Running source ~/.nvm/nvm.sh && nvm use node makes node available, but this requires manual intervention in every command.
Plugins
No response
OpenCode version
1.17.7
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
Ubuntu 24
Terminal
No response
Description
Environment
Problem
When OpenCode executes bash commands,
which nodefails andnode --versioncannot be found, even though nvm is installed.Environment Variables at Runtime
HOME=/home/user
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib
npm_config_user_agent=npm/undefined node/v24.3.0 linux x64 workspaces/false
Expected
which nodeshould return a valid pathnode --versionshould workActual
which node→ no output (node not found)node --version→ command fails/home/hanfengcan/.nvm/versions/node/v24.15.0/bin/nodenpm_config_user_agentshowsnode/v24.3.0instead of nvm'sv24.15.0Root Cause
The PATH does not include nvm's node bin directory. nvm is not automatically sourced in OpenCode's bash execution context.
Steps to Reproduce
Additional Context
Running
source ~/.nvm/nvm.sh && nvm use nodemakes node available, but this requires manual intervention in every command.Plugins
No response
OpenCode version
1.17.7
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
Ubuntu 24
Terminal
No response