After installing brew, watchman and node. I tried to initiate my first react-native application from the terminal on a Mac machine.
When I run the command like it says on React Native Development site – React Native CLI Quickstart for macOS and iOS target.
npx react-native init AwesomeProject
I get the following error
EPERM: operation not permitted, chmod '/usr/local/lib/node_modules/react-native/node_modules/@react-native-community/cli/build/commands/server/external/xsel'
It turns out that the node_modules folder is owned by a different user and thus I didn’t have the permissions to use it.
The solution is the take ownership of the folder at /usr/local/lib/node_modules, you can do this by
cd /usr/local/lib/
chown <your username> node_modules
Now the init command should work and you can get started with your react-native application.