react native 搭建開發環境

react native 搭建開發環境時的終端執行代碼,沒有安Flow和Nuclide


Last login: Wed Sep 21 23:37:49 on ttys000
chenzhongsongdeMacBook-Pro:~ chenzhongsong$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
**==>**** This script will install:**
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
**==>**** The following existing directories will be made group writable:**
/usr/local/bin
**==>**** The following existing directories will have their owner set to ****chenzhongsong**:
/usr/local/bin
**==>**** The following existing directories will have their group set to ****admin**:
/usr/local/bin
**==>**** The following new directories will be created:**
/usr/local/Cellar
/usr/local/Homebrew
/usr/local/Frameworks
/usr/local/etc
/usr/local/include
/usr/local/lib
/usr/local/opt
/usr/local/sbin
/usr/local/share
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var

Press RETURN to continue or any other key to abort
**==>**** /usr/bin/sudo /bin/chmod g+rwx /usr/local/bin**
Password:
**==>**** /usr/bin/sudo /usr/sbin/chown chenzhongsong /usr/local/bin**
**==>**** /usr/bin/sudo /usr/bin/chgrp admin /usr/local/bin**
**==>**** /usr/bin/sudo /bin/mkdir -p /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/sbin /usr/local/share /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var**
**==>**** /usr/bin/sudo /bin/chmod g+rwx /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/sbin /usr/local/share /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var**
**==>**** /usr/bin/sudo /bin/chmod u+rwx share/zsh share/zsh/site-functions**
**==>**** /usr/bin/sudo /usr/sbin/chown chenzhongsong /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/sbin /usr/local/share /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var**
**==>**** /usr/bin/sudo /usr/bin/chgrp admin /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/sbin /usr/local/share /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var**
**==>**** /usr/bin/sudo /bin/mkdir -p /Users/chenzhongsong/Library/Caches/Homebrew**
**==>**** /usr/bin/sudo /bin/chmod g+rwx /Users/chenzhongsong/Library/Caches/Homebrew**
**==>**** /usr/bin/sudo /usr/sbin/chown chenzhongsong /Users/chenzhongsong/Library/Caches/Homebrew**
**==>**** Downloading and installing Homebrew...**
remote: Counting objects: 1033, done.
remote: Compressing objects: 100% (929/929), done.
remote: Total 1033 (delta 95), reused 593 (delta 68), pack-reused 0
Receiving objects: 100% (1033/1033), 1.05 MiB | 7.00 KiB/s, done.
Resolving deltas: 100% (95/95), done.
From https://github.com/Homebrew/brew
 * [new branch]      master     -> origin/master
HEAD is now at bbed724 Merge pull request #1078 from ilovezfs/cmake-weak-symbols
**==>**** Homebrew has enabled anonymous aggregate user behaviour analytics**
Read the analytics documentation (and how to opt-out) here:
  https://git.io/brew-analytics
**==>**** Tapping homebrew/core**
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 3725, done.
remote: Compressing objects: 100% (3617/3617), done.
remote: Total 3725 (delta 15), reused 1247 (delta 0), pack-reused 0
Receiving objects: 100% (3725/3725), 2.91 MiB | 12.00 KiB/s, done.
Resolving deltas: 100% (15/15), done.
Checking connectivity... done.
Tapped 3604 formulae (3,752 files, 9M)

Already up-to-date.
**==>**** Installation successful!**
**==>**** Next steps**
Run `brew help` to get started
Further documentation: https://git.io/brew-docs
**==>**** Homebrew has enabled anonymous aggregate user behaviour analytics**
Read the analytics documentation (and how to opt-out) here:
  https://git.io/brew-analytics
chenzhongsongdeMacBook-Pro:~ chenzhongsong$ 
chenzhongsongdeMacBook-Pro:~ chenzhongsong$ brew install node
Checking out v1.0.2 in /usr/local/Homebrew...
To checkout v1.0.1 in /usr/local/Homebrew run:
  'cd /usr/local/Homebrew && git checkout v1.0.1
**==>**** Auto-updated Homebrew!**
Updated 1 tap (homebrew/core).
**==>**** Updated Formulae**
openssl                                  openssl@1.1                            

**==>**** Downloading https://homebrew.bintray.com/bottles/node-6.6.0.yosemite.bottle.**
######################################################################## 100.0%
**==>**** Pouring node-6.6.0.yosemite.bottle.tar.gz**
**==>**** Using the sandbox**
**==>**** Caveats**
Please note by default only English locale support is provided. If you need
full locale support you should either rebuild with full icu:
  `brew reinstall node --with-full-icu`
or add full icu data at runtime following:
  https://github.com/nodejs/node/wiki/Intl#using-and-customizing-the-small-icu-build

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
**==>**** Summary**
??  /usr/local/Cellar/node/6.6.0: 3,669 files, 41M
chenzhongsongdeMacBook-Pro:~ chenzhongsong$ npm install -g react-native-cli
/usr/local/bin/react-native -> /usr/local/lib/node_modules/react-native-cli/index.js
/usr/local/lib
└─┬ react-native-cli@1.0.0 
  ├─┬ chalk@1.1.3 
  │ ├── ansi-styles@2.2.1 
  │ ├── escape-string-regexp@1.0.5 
  │ ├─┬ has-ansi@2.0.0 
  │ │ └── ansi-regex@2.0.0 
  │ ├── strip-ansi@3.0.1 
  │ └── supports-color@2.0.0 
  ├── minimist@1.2.0 
  ├─┬ prompt@0.2.14 
  │ ├── pkginfo@0.4.0 
  │ ├─┬ read@1.0.7 
  │ │ └── mute-stream@0.0.6 
  │ ├── revalidator@0.1.8 
  │ ├─┬ utile@0.2.1 
  │ │ ├── async@0.2.10 
  │ │ ├── deep-equal@1.0.1 
  │ │ ├── i@0.3.5 
  │ │ ├─┬ mkdirp@0.5.1 
  │ │ │ └── minimist@0.0.8 
  │ │ ├── ncp@0.4.2 
  │ │ └─┬ rimraf@2.5.4 
  │ │   └─┬ glob@7.1.0 
  │ │     ├── fs.realpath@1.0.0 
  │ │     ├─┬ inflight@1.0.5 
  │ │     │ └── wrappy@1.0.2 
  │ │     ├── inherits@2.0.3 
  │ │     ├─┬ minimatch@3.0.3 
  │ │     │ └─┬ brace-expansion@1.1.6 
  │ │     │   ├── balanced-match@0.4.2 
  │ │     │   └── concat-map@0.0.1 
  │ │     ├── once@1.4.0 
  │ │     └── path-is-absolute@1.0.0 
  │ └─┬ winston@0.8.3 
  │   ├── colors@0.6.2 
  │   ├── cycle@1.0.3 
  │   ├── eyes@0.1.8 
  │   ├── isstream@0.1.2 
  │   ├── pkginfo@0.3.1 
  │   └── stack-trace@0.0.9 
  └── semver@5.3.0 

chenzhongsongdeMacBook-Pro:~ chenzhongsong$ brew install watchman
**==>**** Installing dependencies for watchman: ****pcre**
**==>**** Installing watchman dependency: ****pcre**
**==>**** Downloading https://homebrew.bintray.com/bottles/pcre-8.39.yosemite.bottle.t**
######################################################################## 100.0%
**==>**** Pouring pcre-8.39.yosemite.bottle.tar.gz**
??  /usr/local/Cellar/pcre/8.39: 203 files, 5.4M
**==>**** Installing ****watchman**
**==>**** Downloading https://homebrew.bintray.com/bottles/watchman-4.7.0.yosemite.bottle.tar.gz**
######################################################################## 100.0%
**==>**** Pouring watchman-4.7.0.yosemite.bottle.tar.gz**
**==>**** Using the sandbox**
??  /usr/local/Cellar/watchman/4.7.0: 21 files, 428.8K
chenzhongsongdeMacBook-Pro:~ chenzhongsong$ 

接著是測試安裝
終端截圖

Paste_Image.png

接頭方向等待了較長時間(約20分鐘)。截圖中的代碼是接著上面的代碼來的,下面是終端代碼,接著上面的代碼

chenzhongsongdeMacBook-Pro:~ chenzhongsong$ react-native init AwesomeProject
This will walk you through creating a new React Native project in /Users/chenzhongsong/AwesomeProject
Installing react-native package from npm...
Setting up new React Native app in /Users/chenzhongsong/AwesomeProject
AwesomeProject@0.0.1 /Users/chenzhongsong/AwesomeProject
└── react@15.3.2 

**To run your app on iOS:**
   cd /Users/chenzhongsong/AwesomeProject
   react-native run-ios
   - or -
   Open /Users/chenzhongsong/AwesomeProject/ios/AwesomeProject.xcodeproj in Xcode
   Hit the Run button
**To run your app on Android:**
   Have an Android emulator running (quickest way to get started), or a device connected
   cd /Users/chenzhongsong/AwesomeProject
   react-native run-android
chenzhongsongdeMacBook-Pro:~ chenzhongsong$ 

執行成功。呵呵呵

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容