Can't create react native app. Input is required, but expo is in non-interactive mode
I just started learning react native and I'm stuck at the beginning.
I installed react native with npm install -g create-react-native-app
, but when i try to create app with create-react-native-app
it just says:
Input is required, but expo is in non-interactive mode. Required
input:
> Choose a template:
Solution 1:
are you using git bash? try to use normal cmd to create the project
Solution 2:
you can't run the CLI in 'interactive mode' if you are using Git Bash
, instead, you can use cmd
, but if you insist on using Git Bash
then you need to pass 2 arguments: name
and template
. so instead of
expo init <project-name>
you'd actually pass:
expo init <project-name> --template <one-of-the-predefined-templates> --name <AppName>
for example, expo init facebook-clone --template blank --name FacebookClone
the template
argument defines how much boilerplate the project is initiated with
the name
argument defines the app name (as shown in the home screen or even in Expo
itself)
Solution 3:
Use cmd or another TTY command-line tool. Don't use git bash - it is not TTY.
expo --help
Usage: expo [options] [command]
Options:
-V, --version output the version number
-o, --output [format] Output format. pretty (default), raw
--non-interactive Fail, if an interactive prompt would be required to continue. Enabled by default if stdin is not a TTY.
In that case you can all commands mentioned above:
expo init my-new-project
or do expo login first