Open rrojan opened 1 month ago
- Committing files works normally when I do it with the terminal
Could there be something terminal specific that isn't present when you launch GitHub Desktop via the OS launcher? Or are you launching it via the terminal and somehow the PATH
values don't match?
It does look like some parts of the PATH
that GitHub Desktop has are present - where is yarn
meant to be located that it isn't part of this PATH
value?
@shiftkey Okay, it seems that if I run $ github-desktop
on my terminal (kitty
) and try committing changes it works fine. The problem only arises when I open Github Desktop manually from my OS launcher. For the meanwhile I can continue like this :)
yarn
's containing folder not being part of PATH is really weird. It's in /home/roj/.nvm/versions/node/v18.18.2/bin
, which is in the PATH for zsh
(and bash
if that matters). The default terminal for Github Desktop is GNOME Terminal, which runs zsh and yarn
works as expected as an executable.
Is it possible that github-desktop
is somehow overwriting my PATH to something else?
PATH that comes up in error:
Output from echo $PATH
/home/roj/.nvm/versions/node/v18.18.2/bin:/home/roj/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/roj/.local/share/JetBrains/Toolbox/scripts:/var/lib/flatpak/app/dev.zed.Zed/x86_64/stable/29feaf6558a8c888be0fba1f474731bb7775cee82c1dfd126e724122c643e3e7/files/bin
Note that the /usr/lib/github-desktop/resources/app/git/libexec/git-core
path isn't in my actual PATH.
Note that the
/usr/lib/github-desktop/resources/app/git/libexec/git-core
path isn't in my actual PATH.
That's expected - when the app is executing Git commands we want to use the version that the app ships, so prefixing path with that value means it'll be preferred over the app.
yarn
's containing folder not being part of PATH is really weird. It's in/home/roj/.nvm/versions/node/v18.18.2/bin
, which is in the PATH for bothzsh
andbash
(if that matters). The default terminal for Github Desktop is GNOME Terminal, which runs zsh andyarn
also runs as expected as an executable.
I think when using the OS launcher to launch an app it doesn't need a shell, so registering the PATH in a different location would be necessary to get that working. Seeing other tools like JetBrains mentioned in the Desktop error makes me suspect there's a different location at play related to your profile (which your shell is then prepending values to during it's setup), but how to get that to play well with nvm
is something I don't have bandwidth to dig into currently.
@shiftkey After looking around a lot I was still unable to find the path that github-desktop
was taking - I looked at all environment
, profile
files, etc.
For the meanwhile I've symlinked my node binaries to /usr/local/bin
, which works around the issue.
The problem
Every time I try to commit my changes by pressing the "Commit to {branch name}" button, I get a
command not found in PATH
error. I have some pre-commit hooks configured using Husky. These hooks useyarn
, and the error points to yarn not being found in PATH.This is weird because
git commit -m 'something'
)$PATH
does show/home/roj/.nvm/versions/node/v18.18.2/bin
. The PATH for Github Desktop does not!Release version
3.3.12-linux2 amd64
Operating system
Ubuntu 22.04.4 LTS x86_64
Steps to reproduce the behavior
yarn
. In my case I doyarn lint
which simply runs Prettier to check for lint warnings.github-desktop
, add some changes and add commit messageLog files
Screenshots
No response
Additional context
No response