简体   繁体   English

Mix 无法访问它刚刚创建的用于运行 Phoenix 服务器的目录?

[英]Mix can't access a directory it just created to run the Phoenix server?

I am trying to run the Phoenix demo application per the official guide from an Administrator PowerShell session where I am the admin on my machine.我正在尝试按照来自管理员 PowerShell 会话的官方指南运行 Phoenix 演示应用程序,在该会话中我是我机器上的管理员。 I have installed every dependency but when I try to run mix phx.server , it tells me that it couldn't remove a file because (it's) not the owner.我已经安装了所有依赖项,但是当我尝试运行mix phx.server ,它告诉我它无法删除文件,因为(它)不是所有者。 It seems odd that the using mix phx.new hello wouldn't have full control over this file that it just created.使用mix phx.new hello不能完全控制它刚刚创建的这个文件,这似乎很奇怪。 See the following output from my PowerShell session:从我的 PowerShell 会话中查看以下输出:

PS C:\users\Isaiah Nelson\Lab> cd hello
PS C:\users\Isaiah Nelson\Lab\hello> mix ecto.create
Compiling 13 files (.ex)
Generated hello app
The database for Hello.Repo has been created
PS C:\users\Isaiah Nelson\Lab\hello> mix phx.server
** (File.Error) could not remove file "c:/users/Isaiah Nelson/Lab/hello/_build/dev/lib/hello/priv": not owner
    (elixir) lib/file.ex:1128: File.rm!/1
    (mix) lib/mix/utils.ex:452: Mix.Utils.symlink_or_copy/2
    (mix) lib/mix/project.ex:644: Mix.Project.build_structure/2
    (mix) lib/mix/tasks/compile.all.ex:21: Mix.Tasks.Compile.All.run/1
    (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
    (mix) lib/mix/tasks/compile.ex:96: Mix.Tasks.Compile.run/1
    (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
    (mix) lib/mix/tasks/app.start.ex:58: Mix.Tasks.App.Start.run/1

I have since tried scouring the documentation on the Mix Task for phx.server but found no clues why this has happening.从那以后,我尝试搜索有关phx.server的 Mix Task 的文档,但没有发现为什么会发生这种情况的任何线索。 I have also even tried to set the 'hello' directory owner to Administrators, my user (Isaiah Nelson) and 'Everyone' with full control and inherited permissions but still I cannot run the demo app without getting this error.我什至还尝试将“hello”目录所有者设置为管理员、我的用户(以赛亚·纳尔逊)和“所有人”,并具有完全控制和继承权限,但仍然无法运行演示应用程序而不会出现此错误。 Is this a issue with Mix creating files in Windows via Powershell or is this some other Windows file permission issue?这是通过 Powershell 在 Windows 中 Mix 创建文件的问题还是其他一些 Windows 文件权限问题? Either way, how I might fix it so I can run the demo?无论哪种方式,我如何修复它以便我可以运行演示?

If there is no reason to run phx app as administrator, you could "take" ownership recursively of the folder where project is located.如果没有理由以管理员身份运行 phx 应用程序,您可以递归地“获取”项目所在文件夹的所有权。 Right click on folder then Properties > Securty > Advanced (button) then in new window Observe Owner at the top, click on "Change" link and find&pick your username.右键单击文件夹,然后属性 > 安全 > 高级(按钮),然后在顶部的新窗口中观察所有者,单击“更改”链接并找到并选择您的用户名。 Click ok to close search dialog, then select "Replace all child object permission entries with inheritable permission entries from this object".单击确定关闭搜索对话框,然后选择“用可从该对象继承的权限条目替换所有子对象权限条目”。 Finally click Ok (or Apply) and try to run app without elevated rights.最后单击确定(或应用)并尝试在没有提升权限的情况下运行应用程序。

EDIT编辑

I found that in some cases editing code from WSL and later without WSL can mix access rights on file system leading to this or similar behavior, eg can't move folder to different location.我发现在某些情况下,从 WSL 编辑代码,然后在没有 WSL 的情况下编辑代码可能会在文件系统上混合访问权限,从而导致这种或类似的行为,例如无法将文件夹移动到不同的位置。 If this is your case, then I suggest you to decide where your dev environment is, in WSL or in Win.如果这是你的情况,那么我建议你决定你的开发环境在哪里,在 WSL 中还是在 Win 中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法将 icacls 运行到有空格的目录 - Can't run icacls to a directory with spaces .NET Memory 映射文件和任务计划程序,从任务运行时客户端无法访问服务器创建的 MMF - .NET Memory Mapped Files and Task Scheduler, client can't access server-created MMF when running from Task Exchange-以编程方式创建的邮箱无法访问用户的日历 - Exchange - Programmatically Created Mailbox Can't Access Users' Calendars Windows:Elixir phoenix MIX_ENV = prod:该术语无法识别 - Windows: Elixir phoenix MIX_ENV=prod : The term is not recognized 无法在 SQL 服务器代理作业步骤中运行 Powershell 命令 - Can't run a Powershell command in a SQL Server Agent Job Step 无法使用PowerShell从远程服务器访问环境变量 - Can't access Environment Variable from Remote Server with PowerShell RemoteSigned可以运行在同一域上创建的脚本吗? - Can RemoteSigned run scripts created on same domain? 混合纠缠发现和运行变量 - Mix pester Discovery and Run variables 我可以使用wix安装程序来运行几个自定义命令吗 - Can i use a wix installer to just run a couple of custom commands Redis 服务器不能运行超过 1024M 的 maxheap - Redis server can't run more than 1024M maxheap
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM