I learning React-Native with Windows 10, Using Git Bash Command Prompt and Android Studio Emulator.
I have Install React Native globally by using npm install -g react-native-cli
, I always create Project using react-native init ProjectName
and
My Project Launching Method is
go into Project Directory with Git Bash CMD and execute react-native run-android
.
I notice that most of the Project in Github are older version which consist of index.android.js
and index.ios.js
(My Project is newer version so it only have index.js
). I been trying to open some older version Project, but it seem like it just does not launch with the method I mentioned above.
I also have tried react-native start
method from How to open existing project in React Native? but I still not able to launch it.
The error message when I trying to launch the project is Command unrecognized. Make sure that you have run npm install and that you are inside a react-native project.
This Problem only occur when I trying to launch project from Github, when I open my own Project there is no such problem.
ps. If I try use npm install
in the project directory, it will have some error.
I have try to search from Net, most of their launching method are the same as above and does not work for me, so wanna ask that:
Thank you.
Extra Info (React Native CLI and Node Version):
$ react-native -v
react-native-cli: 2.0.1
react-native: n/a - not inside a React Native project directory
> process.version
'v8.9.4' (Node Version)
After whole day of Searching, I have found the Solution.
Whenever open any Project from Github or any sources, we have to ensure that the we have install all the required Dependencies, as Most of the Project using different type of dependencies that you may have not ever install.
Solution:
Download project
git clone https://github.com/parkerdan/SampleNavigation.git
2. Go to the Project Directory and Install dependencies (IMPORTANT)
Note: For unknown reason, npm install
does not work
npm i
or yarn i
Run Project (or any launch method that work you)
react-native run-android