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

2023-10-16 14:28:06 浏览数 (2)

问题

代码语言:javascript复制
$ 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.

解决办法

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

代码语言:javascript复制
sudo chmod go-w /usr/local/bin
sudo chmod go-w /usr/local/sbin

0 人点赞