質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
npm

npmは、Node Packaged Modulesの略。Node.jsのライブラリ・パッケージを管理できるツールです。様々なモジュールを簡単にインストールでき、自分でモジュールを作成し公開する際にも使用できます。

React Native

React Nativeは、ネイティブモバイルアプリ(iOS/Android)を作成できるJavaScriptフレームワークです。Reactと同じ設計のため、宣言的なコンポーネントでリッチなUIを開発することが可能です。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

Q&A

1回答

1112閲覧

CREATE REACT NATIVE APPをNPMでインストールを行う際にエラーが発生する。

3260

総合スコア1

npm

npmは、Node Packaged Modulesの略。Node.jsのライブラリ・パッケージを管理できるツールです。様々なモジュールを簡単にインストールでき、自分でモジュールを作成し公開する際にも使用できます。

React Native

React Nativeは、ネイティブモバイルアプリ(iOS/Android)を作成できるJavaScriptフレームワークです。Reactと同じ設計のため、宣言的なコンポーネントでリッチなUIを開発することが可能です。

Node.js

Node.jsとはGoogleのV8 JavaScriptエンジンを使用しているサーバーサイドのイベント駆動型プログラムです。

0グッド

0クリップ

投稿2020/08/11 09:58

前提・実現したいこと

react native packcageを実行したい

発生している問題・エラーメッセージ

桜マークのWELCOME TO REACT NATIVEが出た際、
To reload the app press "r"
To open developer menu press "d" 

→npm run android、npm run ios を実行。

その後アプリケーションの作成・実行しても上手く行かず。
初心者の質問で大変恐縮ですが分かる方いらっしゃいましたら教えて下さい。

> @ start /Users/user/my-react-app/my-react-app > react-native start ###### ###### ### #### #### ### ## ### ### ## ## #### ## ## #### ## ## ## ## ## ## ### ### ## ## ######################## ## ###### ### ### ###### ### ## ## ## ## ### ### ## ### #### ### ## ### ## #### ######## #### ## ## ### ########## ### ## ## #### ######## #### ## ### ## ### #### ### ## ### ### ## ## ## ## ### ###### ### ### ###### ## ######################## ## ## ### ### ## ## ## ## ## ## #### ## ## #### ## ## ### ### ## ### #### #### ### ###### ###### Welcome to React Native! Learn once, write anywhere To reload the app press "r" To open developer menu press "d" warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB. info Reloading app... warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB. info Reloading app... warn No apps connected. Sending "devMenu" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB. info Opening developer menu... shimoda-no-MacBook-Air:my-react-app user$ npm run android > @ android /Users/user/my-react-app/my-react-app > react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 1277 file(s) to forward-jetify. Using 4 workers... info Starting JS server... /bin/sh: adb: command not found info Launching emulator... error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`. warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch. info Installing the app... No Java runtime present, requesting install. error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 No Java runtime present, requesting install. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ android: `react-native run-android` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ android script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/user/.npm/_logs/2020-08-11T09_39_44_369Z-debug.log shimoda-no-MacBook-Air:my-react-app user$ npm run ios > @ ios /Users/user/my-react-app/my-react-app > react-native run-ios error Could not find "Podfile.lock" at /Users/user/my-react-app/my-react-app/ios/Podfile.lock. Did you run "pod install" in iOS directory? error Could not find the following native modules: RNGestureHandler, RNReanimated, RNScreens. Did you forget to run "pod install" ? info Found Xcode project "myreactapp.xcodeproj" xcrun: error: unable to find utility "simctl", not a developer tool or in PATH error Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues. Run CLI with --verbose flag for more details. Error: Command failed: xcrun simctl list --json devices xcrun: error: unable to find utility "simctl", not a developer tool or in PATH npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ ios: `react-native run-ios` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ ios script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/user/.npm/_logs/2020-08-11T09_40_00_683Z-debug.log shimoda-no-MacBook-Air:my-react-app user$ a -bash: a: command not found shimoda-no-MacBook-Air:my-react-app user$

該当のソースコード

ソースコード

試したこと

ここに問題に対して試したことを記載してください。

補足情報(FW/ツールのバージョンなど)

ここにより詳細な情報を記載してください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

react-native run-android の方のエラーですが、AndroidはAndroid Studio等を利用して事前に仮想デバイスを立ち上げたり、実機を接続しておく必要があります。

react-native run-ios の方は、ios ディレクトリでpod installが実行されていないのでは無いかと思いました。

詳細は以下に書いてある設定にもれがないか確認することをおすすめします。
https://reactnative.dev/docs/environment-setup

投稿2020/08/12 07:02

kmtr

総合スコア213

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問