在尝试创建新的 react native 项目时,我一直遇到“找不到命令”错误。我已经查看了有关此主题的过去问题,他们都说要更改 PATH,这似乎对我不起作用。
我尝试安装和卸载 react-native-cli。我已经检查并更改了 PATH。没有任何效果。
Davids-MBP-2:~ David$ brew -v
Homebrew >=1.7.1 (shallow or no git repository)
Homebrew/homebrew-core (no git repository)
Davids-MBP-2:~ David$ watchman -v
4.9.0
Davids-MBP-2:~ David$ node -v
v11.13.0
Davids-MBP-2:~ David$ npm install -g react-native-cli
/Users/David/.npm-global/bin/react-native -> /Users/David/.npm-global/lib/node_modules/react-native-cli/index.js
+ react-native-cli@2.0.1
updated 1 package in 1.392s
Davids-MBP-2:~ David$ react-native init hello
-bash: react-native: command not found
Davids-MBP-2:~ David$
我安装了 node、homebrew、watchman,最后安装了 react-native。前三个工作,但反应没有。