MacOS上使用 react-native init 初始化项目报错Insecure world writable dir /usr/local/bin in PATH, mode 040777

问题

$ 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.

解决办法

问题是由于目录权限导致的,所以修改一下下面两个目录权限

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

猜你喜欢

转载自blog.csdn.net/kongxx/article/details/132679216