Commit 1a86cf8
fix: resolve shell PATH in Electron to fix 'spawn node ENOENT'
Electron apps launched from Dock/Finder inherit a minimal PATH
(/usr/bin:/bin:/usr/sbin:/sbin) that doesn't include user-installed
node (nvm, volta, homebrew, fnm, etc.). This causes the Claude Agent
SDK's child_process.spawn('node', ...) to fail with ENOENT.
Add fixElectronPath() that runs the user's login shell to resolve
their full PATH before the app starts. Falls back to probing common
node binary directories if shell resolution fails.1 parent dc2211c commit 1a86cf8
1 file changed
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
139 | 178 | | |
140 | 179 | | |
141 | 180 | | |
| |||
0 commit comments