Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OSX] No such file or directory on all rn commands #42

Closed
Alex-Bond opened this issue Dec 29, 2019 · 6 comments
Closed

[OSX] No such file or directory on all rn commands #42

Alex-Bond opened this issue Dec 29, 2019 · 6 comments

Comments

@Alex-Bond
Copy link

Alex-Bond commented Dec 29, 2019

Hi!

Caught some weird bug -
React Native Console: Unable to run the commandline:Cannot run program "react-native" (in directory "/Users/alex/IdeaProjects/someRNProject"): error=2, No such file or directory

It used to work fine, but at some point stopped working. Maybe it's better to move node_modules/.bin to config so you can run commands from there?

Calling react-native from terminal wors fine. NPM/YARN works fine in terminal and plugin as well.

@beansoft
Copy link
Owner

beansoft commented Dec 30, 2019

Which your react native version is it?
My plugin in find react-native command in the PATH env. I'd like to see the result of
which react-native

@Alex-Bond
Copy link
Author

Hey!

So, the RN version is 0.61.2.

Terminal:

When I'm outside of the project:

$ which react-native
react-native not found

Inside project:

$ which react-native
react-native not found

Inside project as well:

$ yarn react-native
yarn run v1.19.2
$ /Users/alex/CodingProjects/titanwinds/TitanWinds/node_modules/.bin/react-native
Usage: react-native [options] [command]

...rest of the help

Same but with npx:

$ npx react-native
Usage: react-native [options] [command]

Options:
  --version                       Print CLI version
  --verbose                       Increase logging verbosity
  -h, --help                      output usage information

...rest of the help

IDEA:

Terminal:

$ which react-native
/Users/alex/CodingProjects/titanwinds/TitanWinds/node_modules/.bin/react-native
$ react-native
Usage: react-native [options] [command]

Options:
  --version                       Print CLI version
  --verbose                       Increase logging verbosity
  -h, --help                      output usage information

...rest of the help
$ yarn react-native      
yarn run v1.19.2
$ /Users/alex/CodingProjects/titanwinds/TitanWinds/node_modules/.bin/react-native
Usage: react-native [options] [command]

Options:
  --version                       Print CLI version
  --verbose                       Increase logging verbosity
  -h, --help                      output usage information

...rest of the help
$ npx react-native  
Usage: react-native [options] [command]

Options:
  --version                       Print CLI version
  --verbose                       Increase logging verbosity
  -h, --help                      output usage information

...rest of the help

IDEA RN Console:
Any command that requires react-native:

Unable to run the commandline:Cannot run program "react-native" (in directory "/Users/alex/CodingProjects/titanwinds/TitanWinds"): error=2, No such file or directory

Yarn, NPM and gradle commands work fine.

@hzw1199
Copy link

hzw1199 commented Jan 14, 2020

I am in the same situation with @Alex-Bond

@beansoft
Copy link
Owner

beansoft commented Jan 15, 2020

i've found the reason, the latest RN 0.60+ no more relay on global rn cli. you can try npm install -g react-native-cli as a temporary fix, and i'll do a plugin update to compatible with both latest and old RN version.

@beansoft
Copy link
Owner

@Alex-Bond
Copy link
Author

@beansoftapp works perfectly! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants