Samuel said to the people, It is Yahweh who appointed Moses and Aaron, and that brought your fathers up out of the land of Egypt.
Thus, Samuel's reference here to Nahash might well have referred to a threat from Nahash at a time previous to his actual invasion.  In an account as abbreviated as this one in First Samuel, in which events separated by years, even decades and centuries, appear side by side, it is simply unintelligent to allege contradictions of statements which we cannot place chronologically in sequence.  If we knew all the facts; and we certainly don't, then we are certain that all would be plain to us.