RN安裝踩坑
阿新 • • 發佈:2019-02-16
git clone https://github.com/facebook/react-native.git
git add . (注:別忘記後面的.,此操作是把Test資料夾下面的檔案都新增進來)
git commit -m "提交資訊" (注:“提交資訊”裡面換成你需要,如“first commit”)
git push -u origin master (注:此操作目的是把本地倉庫push到github上面,此步驟需要你輸入帳號和密碼)
npm install -g 失敗
http://blog.csdn.net/nickfang/article/details/50148049
修改https 配置為http。
執行
npm config set registry http://registry.npmjs.org/
再執行npm install -g React-native-cli 成功。
react-native init AwesomeProject(初始化專案慢)
warning There appears to be trouble with your network connection. Retrying...
1>找到Node.js的安裝目錄,進入nodejs\node_modules\npm找到檔案npmrc,開啟後在該檔案末尾加上
registry = https://registry.npm.taobao.org
2>
npm config set registry https://registry.npm.taobao.org
npm config set disturl https://npm.taobao.org/dist
npm install 特別慢 :
npm config set registry=http://registry.npm.taobao.org/
改完後記得測試下:
npm info react 可以看到倉庫源是淘寶的了
http://blog.csdn.net/coder_nice/article/details/52933187 RN專案安裝後紅色