我是 Flutter 新手,安装后,当我尝试创建项目时出现此错误。
[hello_world] flutter create --ios-language swift --android-language kotlin .
Failed to open or create the artifact cache lockfile: "FileSystemException: Cannot open file, path = '/home/raphael/flutter/flutter/bin/cache/lockfile' (OS Error: Permission denied, errno = 13)"
Please ensure you have permissions to create or open /home/raphael/flutter/flutter/bin/cache/lockfile
Failed to open or create the lockfile
exit code 1
我找不到任何方法来解决这个问题,所以如果有人帮助我,我会很高兴:)
谢谢你!
通过以下方式检查上述目录的权限:
ls -l /home/raphael/flutter/
其中的 flutter 子文件夹应该与您尝试创建项目的当前用户具有相同的用户 ID(或组)。
如果没有,在上述文件夹中时,尝试通过以下方式更改该文件夹的权限:
chown -R YOUR_USERNAME flutter
再次运行第一个命令以验证文件夹中现在是否显示适当的用户。然后尝试再次创建项目。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)