我最近尝试在我的Macbook Pro (2015年初,MacOS v10.13.6)上安装Flutter框架。我解压了/Applications目录中的包,并在我的bash配置文件中创建了相应的路径。但是,作为默认用户在终端上运行flutter doctor命令时,我遇到以下错误。
shlock: open(/Applications/flutter/bin/cache/shlock2538): Permission denied
shlock: open(/Applications/flutter/bin/cache/shlock2540): Permission denied
shlock: open(/Applications/flutter/bin/cache/shlock2542): Permission denied
shlock: open(/Applications/flutter/bin/cache/shlock2544): Permission denied
shlock: open(/Applications/flutter/bin/cache/shlock2546): Permission denied
shlock: open(/Applications/flutter/bin/cache/shlock2548): Permission denied
shlock: open(/Applications/flutter/bin/cache/shlock2550): Permission denied当我使用超级用户权限(sudo)运行flutter doctor命令时,它能够运行,并且我得到以下终端输出。
Woah! You appear to be trying to run flutter as root.
We strongly recommend running the flutter tool without superuser privileges.
/
?
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.6 17G65, locale en)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.1)
[!] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
For more info, see https://flutter.io/platform-plugins
To install:
brew install cocoapods
pod setup
[✓] Android Studio (version 3.1)
[!] Connected devices
! No devices available
! Doctor found issues in 2 categories.我更喜欢以默认用户的身份运行Flutter,而不是以超级用户权限运行(即使我收到了框架的警告,要求以默认用户身份运行)。
谁能帮助我理解如何修复这个错误,并开始使用我的默认用户帐户运行Flutter框架?谢谢。
https://stackoverflow.com/questions/51354351
复制相似问题