首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么Flutter只以超级用户身份运行?

为什么Flutter只以超级用户身份运行?
EN

Stack Overflow用户
提问于 2018-07-16 11:51:38
回答 0查看 5.3K关注 0票数 2

我最近尝试在我的Macbook Pro (2015年初,MacOS v10.13.6)上安装Flutter框架。我解压了/Applications目录中的包,并在我的bash配置文件中创建了相应的路径。但是,作为默认用户在终端上运行flutter doctor命令时,我遇到以下错误。

代码语言:javascript
复制
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命令时,它能够运行,并且我得到以下终端输出。

代码语言:javascript
复制
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框架?谢谢。

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51354351

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档