react-native-console icon indicating copy to clipboard operation
react-native-console copied to clipboard

Unable to run the commandline:Cannot run program "yarn"

Open marcio-inceres opened this issue 1 year ago • 5 comments

Hi!

I already had my environment configured and working to use RN in terminal. I use node 16 and I have yarn installed and globaly. I use nvm to manage my node versions and I have a .nvmrc file in the app folder.

In terminal, when I run yarn run android it work fine but when I try the react-native run-android button from RN Console, I got the error:

Unable to run the commandline:Cannot run program "yarn" (in directory "not-the-real-path-to-app"): error=2, No such file or directory

marcio-inceres avatar Apr 12 '24 21:04 marcio-inceres

Hello, can you provide more info, which operation system are you using?

beansoft avatar Apr 13 '24 03:04 beansoft

Hi!

I'm using Ubuntu 22.04.

This is my main work computer. I already had other JS projects running inm Vue.JS and Angular.JS. I also had a GoDot and Flutter projects running in this computer.

I also use ZSH and Terminator. I use nvm to manage the Node versions and the version I'm using with RN is 16.20.2 and is the same I build the projects in the others frameworks

marcio-inceres avatar Apr 15 '24 15:04 marcio-inceres

Hello, please check if you face issues here: https://github.com/beansoft/react-native-console/issues/17

What's the output of echo $PATH in a terminal? You may replace the real username with something fake.

beansoft avatar Apr 15 '24 15:04 beansoft

echo $PATH

HOME-FOLDER/.rvm/gems/ruby-3.1.4/bin:HOME-FOLDER/.rvm/gems/ruby-3.1.4@global/bin:HOME-FOLDER/.rvm/rubies/ruby-3.1.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:HOME-FOLDER/.local/share/JetBrains/Toolbox/scripts:HOME-FOLDER/Android/Sdk/tools:HOME-FOLDER/Android/Sdk/platform-tools:/usr/bin/docker:HOME-FOLDER/.rvm/bin

I don't have the issues in this ticket. I had the sdk.for settled and I can run react-native run-android in my terminal with success whether in a emulator or in a physical device.

But whan I try to use the Debug Android I got this error:

image

Even if the device is connected and I'm running in it in the terminal using Metro.

marcio-inceres avatar Apr 15 '24 17:04 marcio-inceres

On Linux, the IDE launched from the desktop shortcut didn't pick up the shell envs, this is because the shell and the desktop are using different env configurations(they are two different processes tree in Linux).

Please try to launch the IDE from a terminal by this guide: https://intellij-support.jetbrains.com/hc/en-us/articles/360011901879-How-to-start-IDE-from-the-command-line

Or try setting envs for desktop apps here:

https://wiki.archlinux.org/title/environment_variables#Graphical_environment

Please talk back if this still does not work, then please attach the logs via the menu Help > Collect logs and Diagnostic Data if possible.

beansoft avatar Apr 22 '24 01:04 beansoft