LoginSignup
3

More than 5 years have passed since last update.

ReactNativeの導入(expo)

Last updated at Posted at 2019-02-21

はじめに

react-nativeの導入を公式通りにやっても、自分は八神月くんみたいに計画通り出来ませんでした。詰まった部分とそれを解決した方法を紹介します。

詰まった部分

まず公式の現在の導入手順は

  1. npm install -g expo-cli
  2. expo init AwesomeProject
  3. cd AwesomeProject & npm start

となっています。初心者の自分は2で詰まりました。
具体的にこんなん↓でした。

expo init someProjectname
? Choose a template: expo-template-blank
? Choose which workflow to use: managed
? Please enter a few initial configuration values.
  Read more: https://docs.expo.io/versions/latest/workflow/configuration › 50% completed
 {
   "expo": {
     "name": "<The name of your app visible on the home screen>",
     "slug": "someProjectname"
   }
 }

❯ Required: The name of your app visible on the home screen

expo initでとりあえず適当にenter押していくと3回目から
ここからenter押しても進めない、、、
どうしてだよおおぉお!!!!!!!あああぁぁああ!!!!(cv:藤原竜也)

解決方法

expo init someProjectname --non-interactive --template blank --workflow managed 
--name someProjectname

とやるみたいです。
シェルが対話モード対応だと公式ので上手くいくけど、bashは非対応だからコマンドで操作しなきゃいけない?みたいです。※Google翻訳が吐き出した文を国語が苦手な自分が勝手にそう理解しました。信じるか信じないかは貴方次第です。

workflowをadvancedにする場合

--android-package [name]
--ios-bundle-identifier [name]

この二つも指定しなければいけないようです。

参考

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3