npm ERR!退出,错误代码:128

时间:2018-06-21 13:01:08

标签: ios reactjs react-native

我使用以下链接react-native-vector-icons在我的本机项目中尝试了'RNVectorIcons'软件包。我在终端中使用了 pod install 命令。但是在终端窗口中出现了以下错误

Analyzing dependencies
Fetching podspec for `RNVectorIcons` from `../node_modules/react-native-vector-icons`
Downloading dependencies
Installing RNVectorIcons (4.6.0)
Installing React (0.11.0)
[!] /bin/bash -c 
set -e
npm install --production

npm WARN deprecated connect@2.8.3: connect 2.x series is deprecated
npm WARN deprecated babel-core@5.8.21: Babel 5 is no longer being maintained. Upgrade to Babel 6.
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated line-numbers@0.2.0: Copy its ~20 LOC directly into your code instead.
npm WARN deprecated tough-cookie@1.2.0: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN deprecated coffee-script@1.6.3: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated formatio@1.1.1: This package is unmaintained. Use @sinonjs/formatio instead
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t git://github.com/facebook/react.git
npm ERR! 
npm ERR! undefined
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/macmini1/.npm/_logs/2018-06-21T12_59_11_182Z-debug.log

我的 package.json 文件如下所示:

{
  "name": "sample",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "gulp": "gulp"
  },
  "dependencies": {
    "eslint": "4.19.1",
    "eslint-config-airbnb": "16.1.0",
    "eslint-config-airbnb-base": "12.1.0",
    "eslint-config-rallycoding": "3.2.0",
    "eslint-import-resolver-webpack": "0.10.0",
    "eslint-plugin-import": "2.12.0",
    "eslint-plugin-jsx-a11y": "6.0.3",
    "eslint-plugin-react": "7.8.2",
    "react": "16.3.1",
    "react-native": "0.55.4",
    "react-native-vector-icons": "4.6.0",
    "react-navigation": "2.3.1"
  },
  "devDependencies": {
    "babel-jest": "23.0.1",
    "babel-preset-react-native": "4.0.0",
    "jest": "23.1.0",
    "react-test-renderer": "16.3.1"
  },
  "jest": {
    "preset": "react-native"
  }

debug.log 文件为

1609 verbose stack Error: exited with error code: 128
1609 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/pacote/lib/util/finished.js:12:19)
1609 verbose stack     at ChildProcess.emit (events.js:182:13)
1609 verbose stack     at maybeClose (internal/child_process.js:961:16)
1609 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
1610 verbose cwd /Users/macmini1/Library/Caches/CocoaPods/Pods/Release/React/0.11.0-ab1a2
1611 verbose Darwin 17.0.0
1612 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--production"
1613 verbose node v10.4.1
1614 verbose npm  v6.1.0
1615 error Error while executing:
1615 error /usr/bin/git ls-remote -h -t git://github.com/facebook/react.git
1615 error
1615 error undefined
1615 error exited with error code: 128
1616 verbose exit [ 1, true ]

如何解决此问题?请帮助我

1 个答案:

答案 0 :(得分:5)

您能否提供调试日志的内容?自添加此软件包以来,您是否仅遇到过此问题? 您还可以发布package.json文件的内容吗?

也请看看这个问题/解决方案,看来您遇到的问题是:react-native init AwesomeProject unable to connect to github.com

更新

这可能与访问github的方式有关。您可以先尝试运行以下命令再重试吗?

git config --global url."https://".insteadOf git://