question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-native: command not found

See original GitHub issue

I’ve bootstrapped a new react-native project with the latest react-native-cli and when I try to run it in XCode, I get:

../node_modules/react-native/packager/react-native-xcode.sh: line 36: react-native: command not found

That means I can not anymore run a react-native 0.14 app in my system.

So if I understand this correctly, XCode is calling a shell script. But I’m using nvm and my react-native is not global (unless executing some env files), so I guess xcode don’t execute my env? Also i’m using ZSH.

I feel that the packager should not expect react-native command to exist because it really depend on the env config of each developer and we will likely have a lot of issues like this.

Why is there a strong dependency from react-native packager to react-native-cli ? Someone that fork a react-native example/project should be able to just run it without having to install react-native-cli separately

Workaround: create a ~/.profile that setup the environment and add . ~/.profile at the beginning of ./node_modules/react-native/packager/react-native-xcode.sh … Unfortunately I don’t see a way to setup this in XCode.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:54 (9 by maintainers)

github_iconTop GitHub Comments

21reactions
kamyzdcommented, Aug 25, 2016

Try to do this: $ npm install -g react-native-cli This fixed my issue

18reactions
kristianmandrupcommented, Feb 2, 2016

I came up with the following simple solution:

$ npm install -g react-native-cli
/Users/kris/npm/bin/react-native -> /Users/kris/npm/lib/node_modules/react-native-cli/index.js
/Users/kris/npm/lib
└── react-native-cli@0.1.10

ls /Users/kris/npm

I confirm there is a /bin folder with the react-native binary inside…

I then manually added /Users/kris/npm/bin to my $PATH

export PATH=$PATH:/usr/local/bin/:/Users/kris/npm/bin

IT WORKS!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native: command not found - Stack Overflow
Generally, the issue with command not found is because they are not in PATH . For example, I use nodenv and run npm...
Read more >
Getting a React Native command not found error? Here's how ...
If you are getting this error, it means that either you do not have the CLI installed on your machine, or you do...
Read more >
Possible Solutions Series — react-native: command not found
Hi every one take a look at these solutions one by one. You always need to know this solutions. Try npx react-native.
Read more >
react-native: command not found - YouTube
Support the stream: https://streamlabs.com/svmathtutorError says: react - native : command not found... but solve by npm install -g ...
Read more >
npmglobalpackages: *react-native*: not found - You.com
if it shows command not found the n you have not installed react native in the directory. Do a npm init in new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found