When using react-native init to initialize the project on MacOS, an error message appears: Insecure world writable dir /usr/local/bin in PATH, mode 040777

question

$ react-native init AwesomeProject
...

✖ Installing Ruby Gems
error /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin21/rbconfig.rb:230: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
✖ Installing Ruby Gems
error Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/environment-setup?os=macos&platform=android and follow the React Native CLI QuickStart guide for macOS and iOS.
info Run CLI with --verbose flag for more details.

Solution

The problem is caused by directory permissions, so modify the following two directory permissions.

sudo chmod go-w /usr/local/bin
sudo chmod go-w /usr/local/sbin

Guess you like

Origin blog.csdn.net/kongxx/article/details/132679216