2001 Nissan Xterra - codes

My knock sensor and crankshaft position sensor keep throwing codes. The code-throwing has survived 3 distributors and well over 100,000 miles since they first appeared. The car now has right at 270,000 miles but otherwise feels like it should see 300,000. Is there anything that will fix this issue? At this point I feel like the check engine light is more of a dead man’s trigger: it really causes me to worry when it’s NOT on!

A new engine maybe.

What are the codes?