Tag: Mobile Apps
React Native – expo init fails with git permission denied error on MacOS

This problem can be quite annoying. Here is the part of my iTerm output displaying the error:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | Serdars-MacBook-Pro:ReactNativeProjects serdarosmanonur$ sudo expo init proj2 Password: ? 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 · 100% completed [11:58:15] Extracting project files... [11:58:15] Customizing project... [11:58:15] Unable to initialize git repo. `git` not installed. [11:58:15] Installing dependencies... npm ERR! code 1 npm ERR! Command failed: /usr/local/bin/git clone --depth=1 -q -b expo-font-fix git://github.com/expo/vector-icons.git /Users/serdarosmanonur/.npm/_cacache/tmp/git-clone-3c497330 npm ERR! /Users/serdarosmanonur/.npm/_cacache/tmp/git-clone-3c497330/.git: Permission denied npm ERR! npm ERR! A complete log of this run can be found in: npm ERR! /Users/serdarosmanonur/.npm/_logs/2019-02-09T08_58_32_541Z-debug.log [11:58:32] Process exited with non-zero code: 1 [11:58:32] Set EXPO_DEBUG=true in your env to view the stack trace. |
Here is my expo diagnostics:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | sh-3.2# expo diagnostic "diagnostic" is not an expo command. See "expo --help" for the full list of commands. sh-3.2# expo diagnostics Expo CLI 2.10.0 environment info: System: OS: macOS 10.14.2 Shell: 3.2.57 - /bin/sh Binaries: Node: 10.15.1 - /usr/local/bin/node npm: 6.4.1 - /usr/local/bin/npm IDEs: Android Studio: 3.3 AI-182.5107.16.33.5199772 Xcode: /undefined - /usr/bin/xcodebuild npmGlobalPackages: expo-cli: 2.10.0 |
To solve this I first tried launching a new terminal window and I immediately