EDIT: I am uncertain which steps I took to resolve this problem, and am no longer seeing this error message so I cannot test the solutions below. Please try them individually as different answers seem to be working for different people.
The iOS version works fine, but running Android Studio on my Mac I get the following Gradle Build error (paraphrased):
:ReactNative:Running ‘[node, -e, console.log(require(‘react-native/cli’).bin);]’ command failed.
- Where:
Script ‘/Users/…/Desktop/…/node_modules/@react-native-community/cli-platform-android/native_modules.gradle’ line: 154
- What went wrong:
A problem occurred evaluating script.
> Cannot run program “node”: error=2, No such file or directory
Caused by: java.io.IOException: Cannot run program “node”: error=2, No such file or directory
I've tried so many things:
- Following the React Native development set-up: https://reactnative.dev/docs/environment-setup
- Following this advice about [renaming?] the node path: https://stackoverflow.com/a/54007652
- Following this advice about symlink: https://stackoverflow.com/a/52779097
- Ran brew install node. Message: node 14.2.0 is already installed, it’s just not linked. Tried to run brew link --overwrite node, error /usr/local/share/doc/node is not writable.
- Tried to uninstall and reinstall all the package managers, node, yarn, whatever.
I used to be able to still run yarn android in Terminal, but even that has stopped working.