メインコンテンツへスキップ
見出し画像

Expo(React Native)の開発環境構築、Windows上での手順

    Node.jsをインストール

    1. nodejs.orgからLTS版をダウンロードしてインストール(標準設定のままでOK)

    2. インストール後、コマンドプロンプトで確認:

       node -v
       npm -v

    バージョン番号が表示されればOK

    2. エディタの準備

    Visual Studio 2026でも開けなくはないですが、React Native/Expo開発はVisual Studio Codeの方が圧倒的に定番でスムーズです。code.visualstudio.comからインストールします。

    3. Expoプロジェクトを作成

    コマンドプロンプト/PowerShellで、プロジェクトを置きたい場所に移動してから:

    npx create-expo-app@latest MichikusaNoteExpo --template blank-typescript
    cd MichikusaNoteExpo

    途中で「SDKバージョンを選んでください」と聞かれたら、SDK 54(Expo Goとバージョンを合わせる)を選択してください。
    初回はいくつかパッケージのダウンロードが走ります。「TypeScriptを使うか」等を聞かれたら、TypeScriptを選んでおくのがおすすめです。

    √ Select an Expo SDK version: » For learning with Expo Go (SDK 54)
    Creating MichikusaNoteExpo using the blank-typescript template.
    
    √ Downloaded and extracted project files.
    > npm install
    npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
    npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
    npm warn deprecated glob@7.2.3: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
    npm warn deprecated glob@7.2.3: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
    npm warn deprecated glob@7.2.3: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
    npm warn deprecated glob@7.2.3: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
    npm warn deprecated uuid@7.0.3: uuid@10 and below is no longer supported.  For ESM codebases, update to uuid@latest.  For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).
    
    added 704 packages, and audited 705 packages in 26s
    
    53 packages are looking for funding
      run `npm fund` for details
    
    11 moderate severity vulnerabilities
    
    To address issues that do not require attention, run:
      npm audit fix
    
    To address all issues (including breaking changes), run:
      npm audit fix --force
    
    Run `npm audit` for details.
    
    ✅ Your project is ready!
    
    To run your project, navigate to the directory and run one of the following npm commands.
    
    - cd MichikusaNoteExpo
    - npm run android
    - npm run ios # you need to use macOS to build the iOS project - use the Expo app if you need to do iOS development without a Mac
    - npm run web

    4. iPhoneに「Expo Go」を入れる

    App Storeで「Expo Go」を検索してインストールしてください。これが、Mac無し・ビルド無しで実機確認ができる核心部分です。

    5. 開発サーバーを起動して、その場で実機確認

    プロジェクトフォルダで:

    npx expo start

    ターミナルにQRコードが表示されます。iPhoneのカメラ(またはExpo Goアプリ内のスキャナー)でそのQRコードを読み取ると、その場でアプリが起動します。コードを保存するたびに、iPhone側の画面も自動的に更新されます(ホットリロード)。

    ※ パソコンとiPhoneが同じWi-Fiネットワークに繋がっている必要があります。

    6. ここまでで確認すること

    上記までできれば、「Expo Goでサンプル画面がiPhoneに表示される」状態になっているはずです。

    あなたへのおすすめ