Skip to content

react native template error. [npx react-native init app] #2468

Closed

Description

@ANANT-0000

C:\Users\manis\OneDrive\Documents\React Native>npx react-native init app

Running: npx @react-native-community/cli init

              Welcome to React Native!
             Learn once, write anywhere

warn The directory app contains files that will be overwritten:
.git

√ Do you want to replace existing files? ... yes
⠹ Downloading templateerror Installing pods failed. This doesn't affect project initialization and you can safely proceed.
However, you will need to install pods manually when running iOS, follow additional steps in "Run instructions for iOS" section.

✖ Downloading template

Run instructions for Android:
• Have an Android emulator running (quickest way to get started), or a device connected.
• cd "C:\Users\manis\OneDrive\Documents\React Native\app" && npx react-native run-android

Activity

  1. changed the title [-]react native template error.[/-] [+]react native template error. [npx react-native init app][/+] on Aug 2, 2024
  2. alexandrersantana commented on Aug 3, 2024

    @alexandrersantana

    Is it not running? Try removing the project from OneDrive folder.

  3. RobertFOConnor commented on Aug 12, 2024

    @RobertFOConnor

    Hit the same issue, try initialising from an earlier version of react-native.

    npx react-native@0.74.0 init MyApp --skip-install

  4. RNEvok commented on Aug 14, 2024

    @RNEvok

    Hi! Did you manage to create a new project from template with a newest RN version?

  5. nikandlv commented on Aug 14, 2024

    @nikandlv

    Same error here

  6. RNEvok commented on Aug 14, 2024

    @RNEvok

    Same error here

    I feel like it is related to yarn v4. CLI says that node-modules of template are installed, but I dont see them actually appear on my disk. But the problem is I cant create .yarnrc.yml with nodeLinker: node-modules setting because CLI init command rewrites whole folder...
    (I am not sure for now)

  7. nikandlv commented on Aug 14, 2024

    @nikandlv
  8. thalesaguiar commented on Aug 14, 2024

    @thalesaguiar

    Same error here

    Me too

  9. RNEvok commented on Aug 14, 2024

    @RNEvok

    Solution that I've found:

    1. Create project from template this way:
      npx react-native@latest init myawesomeproject --version 0.74.5 --pm npm --install-pods false

    2. When project is created, install pods the way you usually do it, for example: cd ios && arch -x86_64 pod install for mac with m1 CPU

    P.S. I guess --install-pods false is the point there, but feel free to explore deeper

  10. RNEvok commented on Aug 14, 2024

    @RNEvok

    @thalesaguiar @nikandlv Im gonna tag you so you wont waste any more time

  11. stevepartridge commented on Aug 14, 2024

    @stevepartridge

    I was having the same issue on macos with @react-native-community/cli and was able to get past the template error by setting specific versions (also using yarn vs npm):

    npx @react-native-community/cli@v13.6.5 init AwesomeProject --version 0.74 --pm yarn
    
  12. thalesaguiar commented on Aug 15, 2024

    @thalesaguiar

    Nice!! Now it works, thanks :)

    @thalesaguiar @nikandlv Im gonna tag you so you wont waste any more time

  13. boiboif commented on Aug 15, 2024

    @boiboif

    Same issue

  14. thalesaguiar commented on Aug 15, 2024

    @thalesaguiar

    Now the standard command works: npx @react-native-community/cli@latest init AwesomeProject. But why doesn't it work afterward? Could it be an npm issue? 🤔

  15. eldh0se commented on Aug 15, 2024

    @eldh0se

    Solution that I've found:

    1. Create project from template this way:
      npx react-native@latest init myawesomeproject --version 0.74.5 --pm npm --install-pods false
    2. When project is created, install pods the way you usually do it, for example: cd ios && arch -x86_64 pod install for mac with m1 CPU

    P.S. I guess --install-pods false is the point there, but feel free to explore deeper

    this worked for me after using --install-pods false as suggested by @RNEvok
    Thanks :100

  16. chrischjh commented on Aug 18, 2024

    @chrischjh

    The trick seems to be --pm npm

  17. jozan commented on Aug 20, 2024

    @jozan
    Contributor

    i get similar error on mac when trying to initialize new RN 0.75.2 project.

    npx @react-native-community/cli@latest init App
    
    ✖ Downloading template
    error Installing pods failed. This doesn't affect project initialization and you can safely proceed.
    However, you will need to install pods manually when running iOS, follow additional steps in "Run instructions for iOS" section.
    

    when i use --pm yarn the command runs successfully.

    full output
    npx @react-native-community/cli@latest init App
    
                   ######                ######
                 ###     ####        ####     ###
                ##          ###    ###          ##
                ##             ####             ##
                ##             ####             ##
                ##           ##    ##           ##
                ##         ###      ###         ##
                 ##  ########################  ##
              ######    ###            ###    ######
          ###     ##    ##              ##    ##     ###
       ###         ## ###      ####      ### ##         ###
      ##           ####      ########      ####           ##
     ##             ###     ##########     ###             ##
      ##           ####      ########      ####           ##
       ###         ## ###      ####      ### ##         ###
          ###     ##    ##              ##    ##     ###
              ######    ###            ###    ######
                 ##  ########################  ##
                ##         ###      ###         ##
                ##           ##    ##           ##
                ##             ####             ##
                ##             ####             ##
                ##          ###    ###          ##
                 ###     ####        ####     ###
                   ######                ######
    
    
                  Welcome to React Native 0.75.2!
                     Learn once, write anywhere
    
    ✖ Downloading template
    error Installing pods failed. This doesn't affect project initialization and you can safely proceed.
    However, you will need to install pods manually when running iOS, follow additional steps in "Run instructions for iOS" section.
    
    info 💡 To enable automatic CocoaPods installation when building for iOS you can create react-native.config.js with automaticPodsInstallation field.
    For more details, see https://github.com/react-native-community/cli/blob/main/docs/projects.md#projectiosautomaticpodsinstallation
    
    
    
      Run instructions for Android:
        • Have an Android emulator running (quickest way to get started), or a device connected.
        • cd "/path/to/app/App" && npx react-native run-android
    
      Run instructions for iOS:
        • cd "/path/to/app/App/ios"
    
        • Install Cocoapods
          • bundle install # you need to run this only once in your project.
          • bundle exec pod install
          • cd ..
    
        • npx react-native run-ios
        - or -
        • Open App/ios/App.xcodeproj in Xcode or run "xed -b ios"
        • Hit the Run button
    
      Run instructions for macOS:
        • See https://aka.ms/ReactNativeGuideMacOS for the latest up-to-date instructions.
    
  18. Saifijaved47 commented on Aug 24, 2024

    @Saifijaved47

    Facing the same issue but finally i got a solution:- I was facing problem in my rbenv version first i make it global 3.1.2 and then also make changes in my zshrc file Then i use npx react-native init YourAppName --version 0.73.0 --template react-native-template-typescript
    Using this my app with tempalte was build successfully. **Please note that i have downgraded the version. **

  19. NazimMertBilgi commented on Oct 1, 2024

    @NazimMertBilgi

    Solution that I've found:

    1. Create project from template this way:
      npx react-native@latest init myawesomeproject --version 0.74.5 --pm npm --install-pods false
    2. When project is created, install pods the way you usually do it, for example: cd ios && arch -x86_64 pod install for mac with m1 CPU

    P.S. I guess --install-pods false is the point there, but feel free to explore deeper

    thank you so much..

  20. Jamal-Ud-Din-hub commented on Jan 1, 2025

    @Jamal-Ud-Din-hub

    npx @react-native-community/cli@latest init AwesomeProject

    this worked for me, i have npm and yarn both installed

  21. XiaoPangCao commented on Jan 9, 2025

    @XiaoPangCao

    遇到同样的问题,尝试从早期版本的 react-native 初始化。

    npx react-native@0.74.0 init MyApp --skip-install

    thanks! Your method helped me solve the problem

  22. navinkris commented on Feb 4, 2025

    @navinkris

    npx @react-native-community/cli@latest init AwesomeProject

    this worked for me, i have npm and yarn both installed

    This worked for me as well, Thanks @Jamal-Ud-Din-hub

  23. dev-zhayk commented on Mar 31, 2025

    @dev-zhayk

    I tried this method and managed to install

    npx @react-native-community/cli init AwesomeProject --version 0.78.1

  24. github-actions commented on Jun 30, 2025

    @github-actions

    There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions