React Native 开发环境安装和配置使用报错: -bash: react-native: command not found

Posted 穿山甲随笔-iOS开发

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了React Native 开发环境安装和配置使用报错: -bash: react-native: command not found相关的知识,希望对你有一定的参考价值。

[React  Native 开发环境安装和配置:-bash: react-native: command not found 报错:

 

前提是安装homebrew,node.js ,npm ,watchman,flow都成功。React  Native 开发环境安装和配置

执行react-native init TestProject 命令 创建demo时报错:-bash: react-native: command not found

报错提示:Please include the following file with any support request:  /Users/ewu/npm-debug.log,就是npm-debug.log这个文件有权限,

解决方法

加上sudo(root 权限)再执行命令:

sudo npm install -g react-native-cli

回车提示输入电脑密码,再回车,成功后再创建项目:

react-native init TestProject

--------------------------------- end ------------------------------------------------

终端打印日志表示正在创建:

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/...........

 

以上是关于React Native 开发环境安装和配置使用报错: -bash: react-native: command not found的主要内容,如果未能解决你的问题,请参考以下文章

Mac上react native 开发环境配置

react-native 开发环境搭建

React Native Mac版环境配置

在Mac上搭建React Native开发环境

后盾 React Native 开发系列视频课程

React Native环境配置