When running Enable-SPFeature, you may get the weird error:
“Enable-SPFeature : The file is currently checked out or locked for editing by another user.”
One possible cause of this issue could be that some file(s) the are deployed by the feature could be checked out by a user.
Checking the ULS logs you could find something like
Instantiating module “NAMEOFMODULE”: File could not be added at URL “FILENAME.jpg“: Error 689225296 99e77593-d0d4-49df-adcc-c8f8251fbb82
04/06/2017 20:53:42.02 PowerShell.exe (0x107C) 0x1334 SharePoint Foundation Monitoring b4ly High Leaving Monitored Scope (SPSqlClient). Execution Time=11589.5652 99e77593-d0d4-49df-adcc-c8f8251fbb82
04/06/2017 20:53:42.02 PowerShell.exe (0x107C) 0x1334 SharePoint Foundation General 8kh7 High The file is currently checked out or locked for editing by another user.<nativehr>0x80070021</nativehr><nativestack></nativestack> 99e77593-d0d4-49df-adcc-c8f8251fbb82
04/06/2017 20:53:42.03 PowerShell.exe (0x107C) 0x1334 SharePoint Foundation General aix9j High SPRequest.EnableModuleFromXml: UserPrincipalName=i:0).w|s-1-5-21-995927836-1113283497-4239367599-17896, AppPrincipalName= ,bstrSetupDirectory=C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\Template ,bstrFeatureDirectory=Features\ABCDEP ,bstrUrl=,bstrXML=<Module Name=”images” Path=”Style Library\images” Url=”Style Library/images” RootWebOnly=”TRUE” xmlns=”http://schemas.microsoft.com/sharepoint/”><File ReplaceContent=”True” Type=”GhostableInLibrary” Path=”favicon.ico” Url=”favicon.ico” /><File ReplaceContent=”True” Type=”GhostableInLibrary” Path= ,fForceUnghost=False ,pModuleContext=<null> 99e77593-d0d4-49df-adcc-c8f8251fbb82
04/06/2017 20:53:42.03 PowerShell.exe (0x107C) 0x1334 SharePoint Foundation General ai1wu Medium System.Runtime.InteropServices.COMException: The file is currently checked out or locked for editing by another user.<nativehr>0x80070021</nativehr>
Image may be NSFW.
Clik here to view.

Clik here to view.
