Sure you can change the port every time you get that error or even restart your computer, here is the correct way to go about this
Find what is running on that port and kill the process
Terminal on mac
find the process number
lsof -i: <port number>
eg lsof -i:5001
Then kill the process number
kill -9 <process number>
eg – kill -9 1600