Tristan and Andy's recommendations sound good to me. I'll just add some more detail.
NaN means "Not a Number" and it's part of the way math works in computers. When something goes terribly wrong with the arithmetic (e.g. dividing zero by zero, or subtracting infinity from infinity), the result is NaN.
If you get errors about NaN on the first frame of your setup, then something is probably wrong with the inputs. As Andy said, you might be missing a node or connection. One of your weightmaps might be messed up. Tristan's recommendations could also help in this case.
If you get errors about NaN later in the simulation, it's probably due to a significant collapse or instability in the simulation. Some object has probably exploded or collapsed to nothing. The thing to do in this case is try to make your simulation more stable. Looking at the step/frame before the error happens often reveals a local area of the sim that's spikey or stretching excessively. This is probably the part that's dying on the next frame. In that case, you might be able to attribute it to a problem attachment or other component.