Error al instalar 'react-navigation' obteniendo un error de GIT no dis

Error al instalar 'react-navigation' obteniendo un error de GIT no disponible

Quiero usar react-navigation como se menciona en varios tutoriales y documentos oficiales para usar la navegación de reacción, debe instalarlo usando yarn o NPM. Intenté ambos y obtuve el mismo error.

HILO

>yarn add react-navigation
yarn add v1.5.1
[1/4] Resolving packages...
error An unexpected error occurred: "Couldn't find the binary git".
info If you think this is a bug, please open a bug report with the information provided in "D:\\projects\\ReduxDemo\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

NPM

>yarn add react-navigation
yarn add v1.5.1
[1/4] Resolving packages...
error An unexpected error occurred: "Couldn't find the binary git".
info If you think this is a bug, please open a bug report with the information provided in "D:\\projects\\ReduxDemo\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

D:\projects\ReduxDemo>npm install --save react-navigation
npm WARN addRemoteGit Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:14:12)
npm WARN addRemoteGit     at F (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:69:19)
npm WARN addRemoteGit     at E (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:81:29)
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:90:16
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\index.js:44:5
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:29:5
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:123:15)
npm WARN addRemoteGit  react-navigation/react-native-tab-view resetting remote C:\Users\AppData\Roaming\npm-cache\_git-remotes\git-github-com-react-navigation-react-native-tab-view-git-9747c439 because of error: { Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:14:12)
npm WARN addRemoteGit     at F (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:69:19)
npm WARN addRemoteGit     at E (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:81:29)
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:90:16
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\index.js:44:5
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:29:5
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:123:15) code: 'ENOGIT' }
npm ERR! git clone --template=C:\Users\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/react-navigation/react-native-tab-view.git C:\Users\AppData\Roaming\npm-cache\_git-remotes\git-github-com-react-navigation-react-native-tab-view-git-9747c439: undefined
npm ERR! git clone --template=C:\Users\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/react-navigation/react-native-tab-view.git C:\Users\AppData\Roaming\npm-cache\_git-remotes\git-github-com-react-navigation-react-native-tab-view-git-9747c439: undefined
npm WARN addRemoteGit Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:14:12)
npm WARN addRemoteGit     at F (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:69:19)
npm WARN addRemoteGit     at E (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:81:29)
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:90:16
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\index.js:44:5
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:29:5
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:123:15)
npm WARN addRemoteGit  react-navigation/react-native-tab-view resetting remote C:\Users\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-react-navigation-react-native-tab-view-git-0c5c085d because of error: { Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:14:12)
npm WARN addRemoteGit     at F (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:69:19)
npm WARN addRemoteGit     at E (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:81:29)
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:90:16
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\index.js:44:5
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:29:5
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:123:15) code: 'ENOGIT' }
npm ERR! git clone --template=C:\Users\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/react-navigation/react-native-tab-view.git C:\Users\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-react-navigation-react-native-tab-view-git-0c5c085d: undefined
npm ERR! git clone --template=C:\Users\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/react-navigation/react-native-tab-view.git C:\Users\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-react-navigation-react-native-tab-view-git-0c5c085d: undefined
npm WARN addRemoteGit Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:14:12)
npm WARN addRemoteGit     at F (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:69:19)
npm WARN addRemoteGit     at E (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:81:29)
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:90:16
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\index.js:44:5
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:29:5
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:123:15)
npm WARN addRemoteGit  react-navigation/react-native-tab-view resetting remote C:\Users\AppData\Roaming\npm-cache\_git-remotes\git-github-com-react-navigation-react-native-tab-view-git-b354594d because of error: { Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:14:12)
npm WARN addRemoteGit     at F (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:69:19)
npm WARN addRemoteGit     at E (C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:81:29)
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\which.js:90:16
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\index.js:44:5
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:29:5
npm WARN addRemoteGit     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:123:15) code: 'ENOGIT' }
npm ERR! git clone --template=C:\Users\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:react-navigation/react-native-tab-view.git C:\Users\AppData\Roaming\npm-cache\_git-remotes\git-github-com-react-navigation-react-native-tab-view-git-b354594d: undefined
npm ERR! git clone --template=C:\Users\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:react-navigation/react-native-tab-view.git C:\Users\AppData\Roaming\npm-cache\_git-remotes\git-github-com-react-navigation-react-native-tab-view-git-b354594d: undefined
npm ERR! Windows_NT 10.0.16299
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "react-navigation"
npm ERR! node v6.11.4
npm ERR! npm  v3.10.10
npm ERR! code ENOGIT

npm ERR! not found: git
npm ERR!
npm ERR! Failed using git.
npm ERR! This is most likely not a problem with npm itself.
npm ERR! Please check if you have git installed and in your PATH.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\projects\ReduxDemo\npm-debug.log
Mostrar la mejor respuesta

Sugeriría una forma sucia, vaya a su package.json y agregue "react-navigation": "^1.4.0", dentro de dependencies e intente para ejecutar npm i

manera sucia no funciona! ;)

en serio, no estoy al tanto de la pista de registro de errores como esta npm WARN addRemoteGit Error: not found: git , rofl

Tuve el mismo problema hace unos días. Lo resolví instalando "Git". Puede obtenerlo aquí: Descargar Git

Durante la instalación, habrá una opción en las instrucciones de instalación que debe verificar. Es algo así como agregar git a cmd o ruta. Después de eso, debería intentar instalar el paquete de navegación nuevamente. Funcionó para mí, pero no sé si funcionará para ti.

Necesitas tener git instalado previamente, y debería estar disponible en path

Puedes comprobarlo usando git --version.

Hasta entonces, puede hacer referencia directa al paquete yarn add react-navigation@1.5.1 para una versión específica

También tengo el mismo problema, tengo un conflicto con otra versión de las bibliotecas que usó en su proyecto. Estaba usando react-native-image-picker. Así que da error. entonces, cuando instale la versión a continuación, funcionará bien.

npm install --save react-navigation@1.0.0-beta.27

esto resuelve mi problema

Suponiendo que haya instalado GIT, vaya al directorio que desea ejecutar, luego haga clic derecho en git bash aquí y luego ejecute el comando. ¡Funcionó para mí!