Peel and finely chop the onions and garlic. Chop the basil. Heat water for the pasta and salt well. Cook pasta according to package instructions.
Heat the olive oil in a large frying pan on medium-high heat. When hot, add the onions.
Fry the onions for five minutes until soft, then add the garlic and (optional) red pepper flakes. Fry one-two minutes more until the garlic is lightly browned.
Add the tomato paste and salt, mix well, and fry a further five minutes until darkened and reduced - stir well to avoid the paste burning.
Add the coconut milk and mix, cook a further five minutes until thickened.
Drain the cooked pasta, reserving a cup of pasta water.
Add the cooked pasta and basil to the pan with the sauce and toss to mix.
Add in reserved pasta water, a quarter cup at a time until the sauce is silky smooth yet still clinging to the pasta. You may not need to use all the pasta water (between half a cup to three quarters is usually enough for me).
Serve straight away, optionally with plenty of freshly ground black pepper and vegan parmesan sprinkled over, and enjoy!