Cocoa pods安装RN报错,有谁帮我看下啥问题?



  • 使用Cocoapods安装RN报错,有能帮我看看啥原因的吗?
    -> Installing React (0.11.0)

    Git download
    Git download
    $ /usr/bin/git clone https://github.com/facebook/react-native.git
    /var/folders/3c/2rgqgc0j0l3__vv4lg8pl9z40000gn/T/d20160123-727-7m9bcz
    --single-branch --depth 1 --branch v0.11.0
    Cloning into '/var/folders/3c/2rgqgc0j0l3__vv4lg8pl9z40000gn/T/d20160123-727-7m9bcz'...
    Note: checking out 'e1032e1d0974f4bdcca61ec2255ce7bbb984607e'.

     You are in 'detached HEAD' state. You can look around, make experimental
     changes and commit them, and you can discard any commits you make in this
     state without impacting any branches by performing another checkout.
     
     If you want to create a new branch to retain commits you create, you may
     do so (now or later) by using -b with the checkout command again. Example:
     
       git checkout -b <new-branch-name>
    

    Running prepare command
    $ /bin/bash -c set -e npm install --production
    npm WARN deprecated babel-core@5.8.21: Babel 5 is no longer being maintained. Upgrade to Babel 6.
    npm ERR! fetch failed https://registry.npmjs.org/debug/-/debug-2.1.0.tgz
    npm WARN retry will retry, error on last attempt: Error: socket hang up
    npm ERR! fetch failed https://registry.npmjs.org/babel/-/babel-5.8.21.tgz
    npm WARN retry will retry, error on last attempt: Error: socket hang up
    npm ERR! fetch failed https://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz
    npm WARN retry will retry, error on last attempt: Error: socket hang up
    npm ERR! fetch failed https://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz
    npm WARN retry will retry, error on last attempt: Error: socket hang up
    npm ERR! fetch failed https://registry.npmjs.org/debug/-/debug-2.1.0.tgz
    npm WARN retry will retry, error on last attempt: Error: socket hang up
    npm ERR! fetch failed https://registry.npmjs.org/babel/-/babel-5.8.21.tgz
    npm WARN retry will retry, error on last attempt: Error: socket hang up
    npm ERR! fetch failed https://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz
    npm ERR! fetch failed https://registry.npmjs.org/babel/-/babel-5.8.21.tgz
    npm ERR! fetch failed https://registry.npmjs.org/debug/-/debug-2.1.0.tgz
    npm ERR! Darwin 15.2.0
    npm ERR! argv "/usr/local/Cellar/iojs/3.3.1/bin/iojs" "/usr/local/bin/npm" "install" "--production"
    npm ERR! node v3.3.1
    npm ERR! npm v2.14.4
    npm ERR! code ECONNRESET

    npm ERR! network socket hang up
    npm ERR! network This is most likely not a problem with npm itself
    npm ERR! network and is related to network connectivity.
    npm ERR! network In most cases you are behind a proxy or have bad network settings.
    npm ERR! network
    npm ERR! network If you are behind a proxy, please make sure that the
    npm ERR! network 'proxy' config is set properly. See: 'npm help config'

    npm ERR! Please include the following file with any support request:
    npm ERR! /Users/zhulin/Library/Caches/CocoaPods/Pods/Release/React/0.11.0-7701f/npm-debug.log
    [!] /bin/bash -c
    set -e
    npm install --production

    npm WARN deprecated babel-core@5.8.21: Babel 5 is no longer being maintained. Upgrade to Babel 6.
    npm ERR! fetch failed https://registry.npmjs.org/debug/-/debug-2.1.0.tgz
    npm WARN retry will retry, error on last attempt: Error: socket hang up
    npm ERR! fetch failed https://registry.npmjs.org/babel/-/babel-5.8.21.tgz
    npm WARN retry will retry, error on last attempt: Error: socket hang up
    npm ERR! fetch failed https://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz
    npm WARN retry will retry, error on last attempt: Error: socket hang up
    npm ERR! fetch failed https://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz
    npm WARN retry will retry, error on last attempt: Error: socket hang up
    npm ERR! fetch failed https://registry.npmjs.org/debug/-/debug-2.1.0.tgz
    npm WARN retry will retry, error on last attempt: Error: socket hang up
    npm ERR! fetch failed https://registry.npmjs.org/babel/-/babel-5.8.21.tgz
    npm WARN retry will retry, error on last attempt: Error: socket hang up
    npm ERR! fetch failed https://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz
    npm ERR! fetch failed https://registry.npmjs.org/babel/-/babel-5.8.21.tgz
    npm ERR! fetch failed https://registry.npmjs.org/debug/-/debug-2.1.0.tgz
    npm ERR! Darwin 15.2.0
    npm ERR! argv "/usr/local/Cellar/iojs/3.3.1/bin/iojs" "/usr/local/bin/npm" "install" "--production"
    npm ERR! node v3.3.1
    npm ERR! npm v2.14.4
    npm ERR! code ECONNRESET

    npm ERR! network socket hang up
    npm ERR! network This is most likely not a problem with npm itself
    npm ERR! network and is related to network connectivity.
    npm ERR! network In most cases you are behind a proxy or have bad network settings.
    npm ERR! network
    npm ERR! network If you are behind a proxy, please make sure that the
    npm ERR! network 'proxy' config is set properly. See: 'npm help config'

    npm ERR! Please include the following file with any support request:
    npm ERR! /Users/zhulin/Library/Caches/CocoaPods/Pods/Release/React/0.11.0-7701f/npm-debug.log

    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/executable.rb:70:in execute_command' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/executable.rb:27:inblock in executable'
    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/installer/pod_source_preparer.rb:64:in block (2 levels) in run_prepare_command' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/installer/pod_source_preparer.rb:60:inchdir'
    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/installer/pod_source_preparer.rb:60:in block in run_prepare_command' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/user_interface.rb:59:insection'
    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/installer/pod_source_preparer.rb:59:in run_prepare_command' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/installer/pod_source_preparer.rb:37:inprepare!'
    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/downloader/cache.rb:201:in copy_and_clean' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/downloader/cache.rb:158:inblock (2 levels) in uncached_pod'
    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/downloader/cache.rb:156:in each' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/downloader/cache.rb:156:inblock in uncached_pod'
    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/downloader/cache.rb:180:in call' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/downloader/cache.rb:180:inin_tmpdir'
    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/downloader/cache.rb:152:in uncached_pod' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/downloader/cache.rb:33:indownload_pod'
    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/downloader.rb:34:in download' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/installer/pod_source_installer.rb:113:indownload_source'
    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/installer/pod_source_installer.rb:53:in install!' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:339:ininstall_source_of_pod'
    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:306:in block (2 levels) in install_pod_sources' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/user_interface.rb:80:intitled_section'
    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:305:in block in install_pod_sources' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:297:ineach'
    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:297:in install_pod_sources' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:146:inblock in download_dependencies'
    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/user_interface.rb:59:in section' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:144:indownload_dependencies'
    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/installer.rb:106:in install!' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/command/project.rb:71:inrun_install_with_update'
    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/command/project.rb:101:in run' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/claide-0.9.1/lib/claide/command.rb:312:inrun'
    /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/lib/cocoapods/command.rb:47:in run' /Users/zhulin/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-0.39.0/bin/pod:44:in<top (required)>'
    /Users/zhulin/.rvm/rubies/ruby-2.2.1/bin/pod:23:in load' /Users/zhulin/.rvm/rubies/ruby-2.2.1/bin/pod:23:in<main>'

    [!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.



  • @qwer 说:

    ECONNRESET

    ECONNRESET 是典型的撞墙症状



  • 那请问你要如何解决这个问题呢,弄了很久都不能成功,在线求教。



  • 弄好了,将nmp的registry设置为淘宝的源就好了:
    npm config set registry https://registry.npm.taobao.org npm info underscore