Step 1. Charge your Nexus 4 At least 1 hour even if it’s not showing charging signs.
Step 2. Boot your mobile into Bootloader/Fastboot mode, and connect it with PC using data cable.
Step 3. Download latest version of recovery from here
Step 4. In Download folder of Your PC Press and hold shift key and press right key of your mouse.
Step 5. Now you will see options open Command/powershell window here, click on it.
Step 6. Type fastboot oem unlock, now you will see a option for unlocking your mobile bootloader select yes via volume up key and press power key.
Step 7. Again reboot your mobile into bootloader and in Command/powershell window type fastbootflashrecovery (file name of your recovery file.img) for example twrp-3.2.1-0.img
Step 8. Remove your mobile from PC and Reboot into recovery, this time your mobile will successfully reboot into recovery.