Here's the setup:
- I'm running MX Linux
- I'm trying to work on a React Native application in Android Studio
- React Native relies on NodeJS (and thus the
nodeexecutable) to be available - Android Studio starts via a shell script (
studio.sh) - I use a tool called
asdffor version management of things like NodeJS, which sets up shims to redirect thenodeexecutable to a versioned one - Normally, the shims to redirect the
nodecommand are loaded inside~/.bashrc(or in my case,~/.zshrcbecause I use zsh shell) - When I go to the terminal and output
$PATH, my shims are loaded in there and show in thePATH - When I run Android Studio via my
.desktopfile (whose Exec line looks like:Exec=/home/myuser/android-studio/bin/studio.sh) it cannot locate thenodeexecutable - It seems like the Linux distro I'm using (MX Linux) uses
dashas its default shell - If I run
cat /proc/<PID>/environfor the Android Studio PID I notice thePATHis missing the shims - I've tried:
- Altering the Exec line in the desktop file to run
bash /home/myuser/android-studio/bin/studio.sh - Altering the Exec line to add additional PATH values like
env PATH="$HOME/.asdf/shims" /home/myuser/... - Altering
~/.profileto set up the PATH with the shim values
- Altering the Exec line in the desktop file to run
I've tried everything I can think of to pass these PATH values along to the Android Studio shell script and nothing seems to be working. The only approach that works is for me to start Android Studio from the terminal, and then the PATH is (I assume) inherited and it can find the node executable.
What am I missing here?