Javascript EBUSY:资源繁忙或锁定,打开“PATH HERE”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29853255/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
EBUSY: resource busy or locked, open 'PATH HERE'
提问by user3937122
I know that this was asked before, but I still can't fix my problem. I am still a novice and just learning Javascript currently. And when I tried to save my files yesterday I got this error : EBUSY: resource busy or locked, open 'C:\Users\User\Desktop\Practicing environment\index.html'I have no idea that means. I tried to restart my laptop and it worked for around 5 minutes at max. I can't keep on learning if I can't save it.
我知道之前有人问过这个问题,但我仍然无法解决我的问题。我仍然是新手,目前只是在学习 Javascript。当我昨天试图保存我的文件时,我收到了这个错误: EBUSY: resource busy or locked, open 'C:\Users\User\Desktop\Practicing environment\index.html'我不知道这意味着什么。我试图重新启动我的笔记本电脑,它最多工作了大约 5 分钟。如果我不能保存它,我就无法继续学习。
I tried to change IDE from Atom to Brackets and vice versa, still got the same error when I am trying to save my code.
我尝试将 IDE 从 Atom 更改为 Brackets,反之亦然,但在尝试保存代码时仍然出现相同的错误。


回答by Devin Carpenter
So I'm a little late to the game here...4 years late, but this solution should work.
所以我在这里玩游戏有点晚了......晚了4年,但这个解决方案应该有效。
So this issue is arising because another program has that file open and could change its contents at any time (theoretically) and so your Operating System won't let you try to make changes too. This is typical to all OS's. You wouldn't want multiple copies of the same file open with different programs, because then you wouldn't really know which copy is the file of truth, or how to merge the changes properly, etc. Essentially you need to stop the program that is currently using that file so that you can read/write to it.
因此,出现此问题是因为另一个程序打开了该文件并且可以随时(理论上)更改其内容,因此您的操作系统也不会让您尝试进行更改。这是所有操作系统的典型特征。您不希望使用不同程序打开同一文件的多个副本,因为那样您就不会真正知道哪个副本是真实文件,或者如何正确合并更改等。本质上,您需要停止该程序当前正在使用该文件,以便您可以对其进行读/写。
Anyways. If anyone looking for an answer here is using a Linux/Unix based OS, refer to this post.
无论如何。如果有人在这里寻找答案是使用基于 Linux/Unix 的操作系统,请参阅这篇文章。
If you're running into this issue on a Mac, the post above may work for you also since OSX is Unix based.
如果您在 Mac 上遇到这个问题,上面的帖子也可能对您有用,因为 OSX 是基于 Unix 的。
SOLUTION
解决方案
If you're on Windows 10 (might work for older versions), you can just go to the file location in the file explorer, and try to move it to another folder. Don't try to delete it because it might actually work, but moving it should bring up a popup saying "File In Use" looking like this:
如果您使用的是 Windows 10(可能适用于旧版本),您只需转到文件资源管理器中的文件位置,然后尝试将其移动到另一个文件夹。不要尝试删除它,因为它可能确实有效,但移动它应该会弹出一个弹出窗口,上面写着“正在使用的文件”,如下所示:
So the popup here says "the file is open in Java(TM) Platform SE Binary". That's your ticket.
所以这里的弹出窗口说“文件在 Java(TM) Platform SE Binary 中打开”。那是你的票。
Now go into Task Manager (Ctrl + Shift + ESC in Windows), and find and select the program has the file open, and click 'End Task'. Now you should be free to use/alter/run the file that you couldn't before.
现在进入任务管理器(在 Windows 中为 Ctrl + Shift + ESC),找到并选择打开文件的程序,然后单击“结束任务”。现在您应该可以自由地使用/更改/运行以前无法使用的文件。
Also, in the end restarting your computer will do the same thing generally. But this is faster IMO.
此外,最后重新启动计算机通常会做同样的事情。但这是更快的 IMO。
Hope this helps some people. Cheers.
希望这可以帮助一些人。干杯。
回答by Bryan Rayner
For me, copying the contents of the file into a new file, and then deleting the original file, works to resolve these kinds of errors. After you've deleted the file, create a new one with the same name, and paste back in the content.
对我来说,将文件的内容复制到一个新文件中,然后删除原始文件,可以解决这些类型的错误。删除文件后,创建一个同名的新文件,然后重新粘贴内容。
If the file is auto-generated (for example, Typescript output) then just deleting the file works.
如果文件是自动生成的(例如,Typescript 输出),则只需删除该文件即可。
回答by Ignatius Andrew
Open your IDE as a Administrator, It seems you dont have permission to operate.
以管理员身份打开IDE,好像没有操作权限。
回答by yazantahhan
For locked files, you can use Unlocker programs like IObit Unlocker.
对于锁定的文件,您可以使用像IObit Unlocker这样的 Unlocker 程序。
After installing, right click on the file and choose IObit Unlocker, then click on Unlock. It should work afterwards.
安装后,右键单击该文件并选择IObit Unlocker,然后单击Unlock。它应该在之后工作。
回答by Daniel
TO find out which process is locking this file/folder under Windows 10:
要找出在 Windows 10 下哪个进程正在锁定此文件/文件夹:
Use resmon.exeincluded in Windows (exec resmon.exe from the start menu):
使用Windows 中包含的 resmon.exe(从开始菜单执行 resmon.exe):
- Open Resource Monitor, which can be found By searching for Resource Monitor or resmon.exe in the start menu, or As a button on the Performance tab in your Task Manager
- Go to the CPU tab Use the search field in the Associated Handles section See blue arrow in screen shot below When you've found the handle, you can identify the process by looking at the Image and/or PID column.
- You can then try to close the application as you normally would, or, if that's not possible, just right-click the handle and kill the process directly from there. Easy peasy!
- 打开资源监视器,可以通过在开始菜单中搜索资源监视器或 resmon.exe 或作为任务管理器中性能选项卡上的按钮找到
- 转到 CPU 选项卡 使用关联句柄部分中的搜索字段 请参阅下面屏幕截图中的蓝色箭头 找到句柄后,您可以通过查看图像和/或 PID 列来识别进程。
- 然后您可以尝试像往常一样关闭应用程序,或者,如果这不可能,只需右键单击句柄并直接从那里终止进程。十分简单!
Original answer : https://superuser.com/questions/117902/find-out-which-process-is-locking-a-file-or-folder-in-windows
原始答案:https: //superuser.com/questions/117902/find-out-which-process-is-locking-a-file-or-folder-in-windows
回答by AminRostami
It"s resolved for me with this way:
用这种方式为我解决了:
my file in that Pathis not in use.
我的文件Path不是in use.
I go to distfolder of outputmy project, and remove outputfolder physically.
我去dist文件夹的output我的项目,并删除output物理文件夹。
then this error resolved.
然后这个错误解决了。
回答by Amrita Yadav
Got this when trying to run yarn install. I deleted the "yarn.lock" file and ran yarn installagain. The error didn't show up again.
尝试运行时得到了这个yarn install。我删除了“yarn.lock”文件并yarn install再次运行。错误没有再次出现。
回答by Peter Moses
This also happens if the file you're trying to modify is already opened by another program
如果您尝试修改的文件已被另一个程序打开,也会发生这种情况
回答by Abdurrahman
This can very likely be due to having spaces or special characters in your file path. Make sure to replace spaces with dashes in your path. This made it work for me.
这很可能是由于文件路径中有空格或特殊字符。确保在路径中用破折号替换空格。这使它对我有用。
回答by Roman Yakoviv
It means it is time to turn your machine off and then turn it on again).
这意味着是时候关闭您的机器然后再打开它)。

