GitHub - react-native-community/cli: React Native command line tools
source link: https://github.com/react-native-community/cli
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
React Native CLI
Command line tools that ship with react-native
in form of the @react-native-community/cli
package.
It exposes
react-native
binary, so your can callyarn react-native
ornpx react-native
directly from your project.
Note: CLI has been extracted from core react-native
as a part of "Lean Core" effort. Please read this blog post for more details.
Contents
- Compatibility
- Documentation
- About
- Creating a new React Native project
- Usage in an existing React Native project
- Updating the CLI
- Maintainers
- License
Compatibility
Our release cycle is independent of react-native
. We follow semver and here is the compatibility table:
@react-native-community/cli
react-native
^2.0.0
^0.60.0
^1.0.0
^0.59.0
Documentation
About
This repository contains tools and helpers for React Native projects in form of a command line tool. There's been quite some confusion around that since the extraction from React Native core. Let's clear them up:
- There are currently two CLIs:
@react-native-community/cli
– the one used directly byreact-native
. That makes it a transitive dependency of your project.react-native-cli
– an optional global convenience package, which is a proxy to@react-native-community/cli
and global installation helper. Please consider it legacy, because it's not necessary anymore.
- When we say "the CLI" we mean
@react-native-community/cli
. - We update the CLI independently of React Native itself. Please see how to use the latest version.
- This is a monorepo to keep stuff organized.
We're actively working to make any indirections gone.
Creating a new React Native project
There are two ways to start a React Native project.
Using npx
(recommended)
Available since
[email protected]
This method is preferred if you don't want to install global packages.
npx react-native init MyApp
Using global CLI (legacy)
You'll need to install a global module react-native-cli
and follow instructions there.
We strongly encourage you to only use global
react-native-cli
for bootstrapping new projects. Use local version for everything else.
You can find out more about init command from the documentation
Usage in an existing React Native project
Once you're inside an existing project, a local react-native
binary will be available for you to use. Feel free to use Yarn to call it directly.
Example running start
command in terminal:
yarn react-native start # or: npx react-native start # or node ./node_modules/.bin/react-native start
You can also add npm scripts to call it with whichever package manager you use:
{ "scripts": { "start": "react-native start" } }
Updating the CLI
Because we release independently of react-native
, it happens that you may be locked on a version without fixes for bugs that affect you. Here's how to get it sorted:
- If you use lock files (
yarn.lock
orpackage-lock.json
) - find the@react-native-community/cli
entry, remove it, runyarn install
/npm install
once again. - If you don't use lock files – remove
node_modules
and runyarn install
/npm install
again. - Run
yarn list @react-native-community/cli
ornpm list @react-native-community/cli
and verify you're on the latest version.
After performing these steps you should be on the latest CLI version. Feel free to do it once in a while, because we release often.
Maintainers
- Michał Pierzchała (@thymikee) - Callstack
- Mike Grabowski (@grabbou) - Callstack
- Kacper Wiszczuk (@esemesek) - Callstack
License
Everything inside this repository is MIT licensed.
Recommend
-
14
Linux command line tools and tricks - Part 3 Nov 18, 2013 Here is another sequel to my Linux command line tools and tri...
-
13
Linux command line tools and tricks - Part 2 Oct 1, 2012 Hope you enjoyed the first part of my Linux tools and tricks. Here, I give you few more interesting commands and tools for daily us...
-
8
Linux command line tools and tricks for Linux geeks Sep 19, 2012 I have gathered some of the best and most widely used linux command line tools and tricks from all over the web and from my...
-
7
Writing Command Line Tools in Python - Enter Fire Sep 13, 2019 One of the better ways to understand code is to figure out how exactly something runs. And this can be done from the outside to the inside....
-
10
The shell is a powerful tool that I think most people underestimate and under-utilize. Bash is probably the most common in the community, so we will refer to bash in all the examples, but all shells should support the same concept of redirect...
-
7
RTC Work Item Command Line Work Item Command Line Version 5.3 See Work Item Command Line 5.0 for instructions how to setup and install WCL....
-
7
Tuesday, June 23, 2009 Transparent legend in your plots Have...
-
11
Ever tried to automate your packaging with App Volumes? Recently, VMware released App Volumes 4, version 210...
-
10
Command-line tools for speech and intent recognition on Linuxvoice2json Command-line tools for speech and intent recognition on Linux View on GitHub...
-
7
...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK