react-native init BookSearch 失败

zandeMacBook-Pro:ios zan$ react-native init BookSearch
prompt: Directory BookSearch already exist. Continue?:  (no) yes
This will walk you through creating a new React Native project in /Users/www/ios/BookSearch
Installing react-native package from npm...

npm ERR! git fetch -a origin (git://github.com/facebook/react.git) fatal: unable to connect to github.com:
npm ERR! git fetch -a origin (git://github.com/facebook/react.git) github.com[0: 192.30.252.128]: errno=Operation timed out
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "react-native"
npm ERR! node v4.1.1
npm ERR! npm  v2.14.4
npm ERR! code 128

npm ERR! Command failed: git fetch -a origin
npm ERR! fatal: unable to connect to github.com:
npm ERR! github.com[0: 192.30.252.128]: errno=Operation timed out
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!     /Users/www/ios/BookSearch/npm-debug.log

`npm install --save react-native` failed
阅读 7.2k
2 个回答

已经有提示了,unable to connect to github.com

init的时候,必须有网络能访问GITHUB.com/facebook/react-native 才可以。不知道有没有办法在无网络的状态下初始化项目的。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题