简体   繁体   English

git clone erron on react native如何解决这个问题

[英]git clone erron on react native how to resolve this

I was trying to setup react native project but i got this error how to resolve this 我试图设置反应本机项目,但我得到此错误如何解决此问题

npm WARN react-redux@5.0.5 requires a peer of react@^0.14.0 || ^15.0.0-0 || ^16.0.0-0 but none was installed.
Installing dependencies using npm...

npm WARN addRemoteGit Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:13:12)
npm WARN addRemoteGit     at F (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:68:19)
npm WARN addRemoteGit     at E (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:80:29)
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:89:16
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\node_modules\isexe\index.js:42:5
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:36:5
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:152:21)
npm WARN addRemoteGit  expo/node-websql#18.0.0 resetting remote C:\Users\VA\AppData\Roaming\npm-cache\_git-remotes\git-github-com-expo-node-websql-git-18-0-0-17a6eb60 because of error: { Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:13:12)
npm WARN addRemoteGit     at F (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:68:19)
npm WARN addRemoteGit     at E (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:80:29)
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:89:16
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\node_modules\isexe\index.js:42:5
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:36:5
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:152:21) code: 'ENOGIT' }
npm ERR! git clone --template=C:\Users\VA\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/expo/node-websql.git C:\Users\VA\AppData\Roaming\npm-cache\_git-remotes\git-github-com-expo-node-websql-git-18-0-0-17a6eb60: undefined
npm ERR! git clone --template=C:\Users\VA\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/expo/node-websql.git C:\Users\VA\AppData\Roaming\npm-cache\_git-remotes\git-github-com-expo-node-websql-git-18-0-0-17a6eb60: undefined
npm WARN addRemoteGit Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:13:12)
npm WARN addRemoteGit     at F (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:68:19)
npm WARN addRemoteGit     at E (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:80:29)
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:89:16
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\node_modules\isexe\index.js:42:5
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:36:5
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:152:21)
npm WARN addRemoteGit  expo/node-websql#18.0.0 resetting remote C:\Users\VA\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-expo-node-websql-git-18-0-0-9423671b because of error: { Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:13:12)
npm WARN addRemoteGit     at F (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:68:19)
npm WARN addRemoteGit     at E (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:80:29)
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:89:16
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\node_modules\isexe\index.js:42:5
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:36:5
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:152:21) code: 'ENOGIT' }
npm ERR! git clone --template=C:\Users\VA\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/expo/node-websql.git C:\Users\VA\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-expo-node-websql-git-18-0-0-9423671b: undefined
npm ERR! git clone --template=C:\Users\VA\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/expo/node-websql.git C:\Users\VA\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-expo-node-websql-git-18-0-0-9423671b: undefined
npm WARN addRemoteGit Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:13:12)
npm WARN addRemoteGit     at F (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:68:19)
npm WARN addRemoteGit     at E (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:80:29)
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:89:16
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\node_modules\isexe\index.js:42:5
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:36:5
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:152:21)
npm WARN addRemoteGit  expo/node-websql#18.0.0 resetting remote C:\Users\VA\AppData\Roaming\npm-cache\_git-remotes\git-github-com-expo-node-websql-git-18-0-0-8213877d because of error: { Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:13:12)
npm WARN addRemoteGit     at F (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:68:19)
npm WARN addRemoteGit     at E (C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:80:29)
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:89:16
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\node_modules\isexe\index.js:42:5
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\which\node_modules\isexe\windows.js:36:5
npm WARN addRemoteGit     at C:\Users\VA\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:152:21) code: 'ENOGIT' }
npm ERR! git clone --template=C:\Users\VA\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:expo/node-websql.git C:\Users\VA\AppData\Roaming\npm-cache\_git-remotes\git-github-com-expo-node-websql-git-18-0-0-8213877d: undefined
npm ERR! git clone --template=C:\Users\VA\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git@github.com:expo/node-websql.git C:\Users\VA\AppData\Roaming\npm-cache\_git-remotes\git-github-com-expo-node-websql-git-18-0-0-8213877d: undefined
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! A complete log of this run can be found in:
npm ERR!     C:\Users\VA\AppData\Roaming\npm-cache\_logs\2017-07-17T09_17_53_803Z-debug.log
`npm install --save` failed

Ensure that you have installed GIT in your machine, If not, go and grab a copy here => https://git-scm.com/downloads and download/install based on your environment. 确保已在计算机中安装了GIT ,否则请在此处获取一个副本=> https://git-scm.com/downloads并根据您的环境下载/安装。

If you already have any other git client (like, SmartGit, TortoiseGIT or SourceTree) you can use the below command to set the path to point the portable git. 如果您已经有任何其他git客户端(例如SmartGit,TortoiseGIT或SourceTree),则可以使用以下命令来设置指向便携式git的路径。

set path=%PATH%;YOUR_GIT_PATH

Hope this helps! 希望这可以帮助!

I had the same problem - in my case it had to do with Cygwin. 我遇到了同样的问题-就我而言,这与Cygwin有关。 The install script requires absolute paths starting with c:\\ but in a Cygwin environment this would be something like /cygdrive/c/ . 安装脚本需要以c:\\开头的绝对路径,但是在Cygwin环境中,这类似于/cygdrive/c/ The required paths can't be resolved and the installation fails. 所需的路径无法解析,安装失败。

In that case the solution is simple: Exit Cygwin and use the standard shell for npm i . 在这种情况下,解决方案很简单:退出Cygwin并将标准外壳用于npm i

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM