React Native 開發環境安裝和配置使用報錯: -bash: react-native: command not found

[React  Native 開發環境安裝和配置:-bash: react-native: command not found 報錯: node

 

前提是安裝homebrew,node.js ,npm ,watchman,flow都成功。react

執行react-native init TestProject 命令 建立demo時報錯:-bash: react-native: command not foundnpm

報錯提示:Please include the following file with any support request:  /Users/ewu/npm-debug.log,就是npm-debug.log這個文件有權限,react-native

解決方法

加上sudo(root 權限)再執行命令:bash

sudo npm install -g react-native-cliapp

回車提示輸入電腦密碼,再回車,成功後再建立項目:spa

react-native init TestProjectdebug

--------------------------------- end ------------------------------------------------日誌

終端打印日誌表示正在建立:homebrew

This will walk you through creating a new React Native project in /Users/maple/Downloads/hellow/Hellotestddd

Installing react-native package from npm...

Setting up new React Native app in /Users/...........

相關文章
相關標籤/搜索