I'm assuming this is Windows... I had the same issue after updating to Windows 10 and found that the issue is with Windows Security Settings on the folder.
First Quit iTunes.
Go to your Music Library in File Explorer and find the iTunes Folder. Right-click the folder and select Properties.
Select the Security tab at the top then click the "Advanced" button near the bottom of the window.

At the top of the Advanced Security window which opens it will show an Owner for the folder.

If the owner is not the name you log onto the computer with, click the "Change" link next to the shown username and change type your username into the new window

Once done, click Check Names and it should change to something like <Computer>\<Name>. Click OK on this window, then tick the box "Replace all child object permission entries..." on the Advanced Security Settings window before clicking OK on that. It will ask you to confirm you want to make these changes so confirm it and allow it to finish.
Once done, click OK on the original properties window, close File Explorer and re-open iTunes.
When you re-sync your iPhone, Error -54 should be gone.
nb. If using Mac OS, Open Finder, Click the "Go" menu at the top of the screen and select "Go To Folder". Enter "~/Music" (without the quotes!) and hit enter. Ctrl+Click the iTunes folder and select "Get Info" on the menu. Expand the section for Permissions at the bottom of the info window. Unlock the padlock, Select your username and make sure it is set as "Read and Write", then click the cogwheel button and make yourself the owner. Then click the cogwheel again and apply to enclosed items. Once done, reopen iTunes and the error should be fixed