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

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

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

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

React Native

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

Q&A

1回答

683閲覧

npmのインストールが上手くいかない

3260

総合スコア1

npm

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

React Native

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

0グッド

0クリップ

投稿2020/08/11 09:43

@ 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"

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$

コード

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

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

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

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

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

guest

回答1

0

提示された内容だけだとイマイチ判断できないため多分に推測を含みますが・・・
Androidはエミュレータが存在するかを確認する必要があります。
下記コマンドを実行してみてください。

emulator -list-avds

iOSPodfile.lockがないようなので、まずはiosディレクトリで下記コマンドを実行してみてください(cocoapodsはインストールされている前提で話しています)。

pod install

いずれにせよ下記公式を一読されることをお勧めします。

投稿2020/08/18 08:05

nekoniki

総合スコア2409

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

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

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

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問