Fortunately, macports can get rid these kind of errors by cleaning up the damaged package using sudo port clean package_name command. You can install the package again after cleaning up.
Therefore, I use these commands to do that
sudo port clean ncurses sudo port selfupdate // make sure the port is in the latest version sudo port install ncursesYou can use it to do the same on other package, just change ncurses with the broken package name.