无法在Windows上安装react-native

时间:2015-09-25 11:43:35

标签: node.js windows git npm react-native

由于本机应用程序可以在Windows中进行微调手动调整,因此我想安装它。

我通过CLI成功地回复了回购,但是当谈到npm install时,控制台抛出了这个:

npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:203:12)
npm WARN addRemoteGit     at emitTwo (events.js:87:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:172:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:817:16)
npm WARN addRemoteGit     at Socket.<anonymous> (internal/child_process.js:319:11)
npm WARN addRemoteGit     at emitOne (events.js:77:13)
npm WARN addRemoteGit     at Socket.emit (events.js:169:7)
npm WARN addRemoteGit     at Pipe._onclose (net.js:469:12)
npm WARN addRemoteGit  git://github.com/facebook/react.git#b4e74e38e43ac53af8acd62c78c9213be0194245 resetting remote C:\
Users\***\AppData\Roaming\npm-cache\_git-remotes\git-github-com-facebook-react-git-baa2986b because of error: { [Error:
 Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit ]
npm WARN addRemoteGit   killed: false,
npm WARN addRemoteGit   code: 1,
npm WARN addRemoteGit   signal: null,
npm WARN addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
npm ERR! git clone --template=C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/
facebook/react.git C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\git-github-com-facebook-react-git-baa2986b: Clon
ing into bare repository 'C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\git-github-com-facebook-react-git-baa2986
b'...
npm ERR! git clone --template=C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/
facebook/react.git C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\git-github-com-facebook-react-git-baa2986b: fata
l: unable to connect to github.com:
npm ERR! git clone --template=C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/
facebook/react.git C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\git-github-com-facebook-react-git-baa2986b: gith
ub.com[0: 192.30.252.130]: errno=No error
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-
cli.js" "install"
npm ERR! node v4.1.1
npm ERR! npm  v2.14.4
npm ERR! code 128

npm ERR! Command failed: git -c core.longpaths=true clone --template=C:\Users\***\AppData\Roaming\npm-cache\_git-remote
s\_templates --mirror git://github.com/facebook/react.git C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\git-githu
b-com-facebook-react-git-baa2986b
npm ERR! Cloning into bare repository 'C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\git-github-com-facebook-reac
t-git-baa2986b'...
npm ERR! fatal: unable to connect to github.com:
npm ERR! github.com[0: 192.30.252.130]: errno=No error
npm ERR!
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\***\react-native\npm-debug.log

这就是npm.debug.log所拥有的:

3616 error git clone --template=C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/facebook/react.git C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\git-github-com-facebook-react-git-baa2986b: Cloning into bare repository 'C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\git-github-com-facebook-react-git-baa2986b'...
3616 error git clone --template=C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/facebook/react.git C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\git-github-com-facebook-react-git-baa2986b: fatal: unable to connect to github.com:
3616 error git clone --template=C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/facebook/react.git C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\git-github-com-facebook-react-git-baa2986b: github.com[0: 192.30.252.130]: errno=No error
3617 verbose stack Error: Command failed: git -c core.longpaths=true clone --template=C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/facebook/react.git C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\git-github-com-facebook-react-git-baa2986b
3617 verbose stack Cloning into bare repository 'C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\git-github-com-facebook-react-git-baa2986b'...
3617 verbose stack fatal: unable to connect to github.com:
3617 verbose stack github.com[0: 192.30.252.130]: errno=No error
3617 verbose stack
3617 verbose stack
3617 verbose stack     at ChildProcess.exithandler (child_process.js:203:12)
3617 verbose stack     at emitTwo (events.js:87:13)
3617 verbose stack     at ChildProcess.emit (events.js:172:7)
3617 verbose stack     at maybeClose (internal/child_process.js:817:16)
3617 verbose stack     at Socket.<anonymous> (internal/child_process.js:319:11)
3617 verbose stack     at emitOne (events.js:77:13)
3617 verbose stack     at Socket.emit (events.js:169:7)
3617 verbose stack     at Pipe._onclose (net.js:469:12)
3618 verbose cwd C:\Users\***\react-native
3619 error Windows_NT 6.1.7601
3620 error argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
3621 error node v4.1.1
3622 error npm  v2.14.4
3623 error code 128
3624 error Command failed: git -c core.longpaths=true clone --template=C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/facebook/react.git C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\git-github-com-facebook-react-git-baa2986b
3624 error Cloning into bare repository 'C:\Users\***\AppData\Roaming\npm-cache\_git-remotes\git-github-com-facebook-react-git-baa2986b'...
3624 error fatal: unable to connect to github.com:
3624 error github.com[0: 192.30.252.130]: errno=No error
3625 error If you need help, you may report this error at:
3625 error     <https://github.com/npm/npm/issues>
3626 verbose exit [ 1, true ]

请注意,由于个人信息,我用***隐藏了一些路径。

问题是我可以完美地连接到Github,并对我的回购做标准操作,我可以手动git克隆反应原生回购。

我试过this,这似乎解决了我的问题,但没有成功。

1 个答案:

答案 0 :(得分:4)

问题出现了,因为我在公司代理服务器后面。我通过运行

解决了这个问题
function check_validation() {
    var Fname = document.frm.Fname.value;
    var Lname = document.frm.Lname.value;
    var valid = true;
    document.getElementById("error").innerHTML = '';
    if (Fname == "") {
        valid = false;
        document.getElementById("error").innerHTML += 'First name is required';
    }
    if (Lname == "") {
        valid = false;
        document.getElementById("error").innerHTML += 'Last name is required';
    }
    return valid;
}

强制所有与GitHub的连接都是通过https。