use create-react-native-app without expo-cli - react-native

I have set up create-react-native-app as said in the react native docs. If my project name is proj, according to the docs, the commands to be run should be :
create-react-native-app proj
cd proj
npm start
But when I run create-react-native-app, I get a menu to select a blank template or the one with tabs. And instead of npm start, it says to use expo start. Why am I getting a different output compared to the docs?

You can use:
react-native init projectName

Official documentation indicates different steps:
https://github.com/react-community/create-react-native-app#create-react-native-app
if you don't want to use Expo, just follow the eject steps:
https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md. Optionally you can reate
or you can create a react native app by yourself without using the create-react-native-app script. More details here, https://facebook.github.io/react-native/docs/getting-started.html#creating-a-new-application

You can use the executable react-native package. This will not require you to install react-native as a global dependency:
npx react-native init yourProjectName

Related

npx react-native init hangs without any output

I want to create a new react-native project using this command in the terminal of visual studio :
npx react-native init project-name
But the terminal freezes for 10 minutes in this line
⸨⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⸩ ⠇ rollbackFailedOptional: verb npm-session e582ffa365b35dcf
Screenshot
I've tried these solutions but none of them worked for me.
When I tried npx create-react-app teachat, it worked very well. I got confused if the problem is related to npm or react-native.
For these reasons it could occure.
1.network connectivity: some times your internet connection is okay but some applications may interfere when downloading dependency. In this case, try using a different network.
Try removing react-native-cli from global installation with this npm uninstall -g react-native-cli
3.Try different version or typescript template
npx react-native init projectname --version X.XX.X or npx react-native init AwesomeTSProject --template react-native-template-typescript
The react native cli is a deprecated method of creating react native projects,the init method is the one currently in use. Check under Creating a new application the official docs
Uninstall react-native-cli and use the same command as you did npx react-native init projectname

I want to start with react native without expo method.. i found this error

I got this error when i am trying to run my app in original device, everything according to react-native documentation
Try running your app with the yarn command, otherwise run npm-doctor to make sure all your packages are updated and fixed.
otherwise try installing dependencies for expo using :
npm install -g yarn
yarn add global react-native
yarn add global react-native-cli
react-native init sample
here's a quick link to the npm-doctor documentation:
https://docs.npmjs.com/cli-commands/doctor.html
Also here's some tutorial on running react-native app using yarn command:
How do I create a React Native project using Yarn?
I find this solution .. i just replace 6.2 with 6.3
in android/gradle/ gradle-wrapper.properties
distributionUrl=https://services.gradle.org/distributions/gradle-6.3-all.zip

react-native eject not working for react-native 0.60.0

Is react-native eject is not working anymore ? is it completely removed from the react-native? I am using react-native version 0.60.0.
I can't even find it in the react-native help.
Please check the image for more reference:
Same here. In this moment, have a brand new backup of your project and then copy the android and ios folder, is the better way to regenerate those folders... unfortunately
UPDATE
react-native upgrade --legacy true
Firstly you would need to install react-native-eject then you can run react-native eject.
Simply do these:
npm i react-native-eject
or
yarn add react-native-eject
then run:
react-native eject
Yes, the eject command was removed from react-native recently (March 28, 2019).
React Native had this command in the previous version. Running this command will check if the ios and android directories exist and then rebuild whichever one is missing.
react-native eject <=0.59.0
Now you should use the react-native upgrade --legacy true command to back up your android folders or ios as the case may be as this command will replace your files.
react-native eject has been deprecated use npx react-native eject its working
eject isn't part of react-native, but rather expo. To eject, you can run:
npm run eject

"react-native eject": Unrecognized command "eject"

I am trying to recreate ios and android folders for my react-native project. As far as I know this is done with the command:
react-native eject
But I get the error:
error Unrecognized command "eject".
I am doing something wrong? How should I recreate android and ios folders?
react-native-cli: 2.0.1
npm i react-native-eject
npm i #react-native-community/cli
react-native eject
will generate the both android and ios folder
It did work in 0.59.9. This threw me too this morning after I upgraded to 0.60. Apparently you now have to run react-native upgrade --legacy true. react-native eject was much easier IMHO.
yarn add react-native-eject
react-native eject
This two-line of code solved my problem with the eject error.
Nikita is 100% correct. If the project was initialized in expo running react native eject will "eject" the project from the expo dependencies (and expo environment) and create a standalone react native project outside the expo environment. This typically adjusts the dependencies in the pakage.json file.
The command exists as a part of expo.
To initialize a project from scratch react-native init will create android and ios folders. Also ensure if you have cloned the directory to run either npm install or yarn to install the dependencies.
If the project was initialized the way I imagine yours was the commmand you are looking for would be one of the following:
react-native run ios or react-native run ios --device
react-native run android or react-native run android --device
For RN projects, which are initiated by react-native init there is no such command, by default RN is using metro bundler instead of web-version of React, where you can configure Parcel/Webpack/Rollup or run create-react-app where actually you can eject.
This question is suitable for expo where you can actually eject, if you need some native modules that are not included in expo.
Try to use expo
react-native eject and upgrade --legacy true aren't working for me.
In the end, I just created a new blank RN project and this had an ios folder. Copied the folder over to my existing project and ... seems to work.
Run npm i react-native-eject
Run npm i #react-native-community/cli --force
Note: use npx instead of npm
npx react-native eject
cd android
./gradlew.bat installDebug
cd..
npm run android

How to install native base in expo project?

I tried many ways to install native base in expo project
I was thinking this command will work
$ npm install native-base --save
but I can install native base in react native with this command
After you follow the quick start here
you have to follow Setup with CRNA steps to create React Native project using the CRNA cli.
I think you missing Install #expo/vector-icons step here.
I've created native-base working with expo environment named "expo-base".
You can check this out from here :-)
https://github.com/Dibyasundar444/expo-base