From all indications, both the Chinese or the Italians invented spaghetti.
And it seems that many other cultures around the world invented noodles independent of outside influence as well.
The popular story, of course, is that Marco Polo brought pasta back from his trips to China sometime around 1295. However, Italian records from a decade earlier indicate that ravioli was a favorite dish of the Romans, years before Marco’s return.
And fettuccini’s history predated ravioli’s for certain. This doesn’t mean that pasta was found in Italy before it was being consumed in China.
The reverse is probably true: At least 3,000 years ago, the Chinese were making pasta out of bean and rice flour.
But Italy likely developed the dish without any help from China.