问题一:-bash: react-nstive: command not found
解决方法:
1.执行 $ export PATH="/usr/local/share/npm/bin:$PATH",
如果上面方法不能解决,试试下面的:
2.首先查看npm的安装路径:
npm list -g | head -n 1
我本机打印出来的是:/usr/local/Cellar/node/10.11.0/lib
3.将1方法里的路径修改成"/usr/local/Cellar/node/10.11.0/bin",
再次执行 $ export PATH="/usr/local/Cellar/node/10.11.0/bin:$PATH"
问题二:WebStorm编译无法识别ios模拟器,报错:xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
在已经装了xcode的前提下,终端执行如下命令 sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/
问题三:RN环境配置好后,如果关闭终端,又出现-bash: react-nstive: command not found
接下来配置linuxPath(当你运行一个命令,会在这些path里搜索,发现就执行):
1.打开path路径:执行$ vim ~/.bash_profile,
2.在打开的文件里加入如下内容,然后wq退出:
export RN=/usr/local/Cellar/node/10.11.0/bin
export PATH=$RN:$PATH
3.执行source语句使其生效
$ source ~/.bash_profile
4.执行 $ echo $PATH,就可以看到刚刚添加进去的路径了