sudo kill -9 $(sudo lsof -t -i:9001)

Here: 9001 is the port number. Change this number to your necessary port number.