irpas技术客

React Native 初次安裝踩坑_tp27933

网络投稿 4737

這次終於燃起了學習react的動力,在初步了解後開始進入react native的學習,更早之前其實有玩過expo,不過使用expo也會有些無法使用原生套件的問題,既然要先學習就從扎實的開始吧!

安裝react native

首先一開始我先安裝了全局

react-native init yourProjectName

後來在跑的時候卻報錯了

?typeError: cli.init is not a function

搜索了下解決方法是删除全局的react-native-cli

npm uninstall -g react-native-cli

隨後再次run了建立的指令,不意外的又報錯了....

bundle installYour Ruby version is 2.6.6, but your Gemfile specified 2.7.5

於是繼續google,解決方案則是:?將Gemfile裡的版本改成設置提示版本

#You can try these commands to install and change global Ruby version to 2.7.5 brew update brew install ruby-build brew install rbenv # If you're using rvm: rvm install 2.2.5 rvm use 2.2.5 # else if you're using rbenv: rbenv install 2.7.5 rbenv global 2.7.5 #After that, you need to export some configurations to define rbenv as default global ruby: echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc echo 'eval "$(rbenv init -)"' >> ~/.zshrc

其餘遇見的錯誤:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

解決:

直接去Apple 官網下載最新版本的Command Line Tools安裝即可,然後再通過brew config查看當前CLI版本號是否變更 鏈接:https://developer.apple.com/download/more/

其他問題遇到持續在更新~


1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,会注明原创字样,如未注明都非原创,如有侵权请联系删除!;3.作者投稿可能会经我们编辑修改或补充;4.本站不提供任何储存功能只提供收集或者投稿人的网盘链接。

标签: #React #Native #初次安裝踩坑 #TypeError #cliinit