Heat some oil in a pan or saucepan and sweat the onion in it. Add the garlic. Pour coconut milk and water on top. Don`t worry: looks like a lot of liquid, but evaporates. Add the vegetable stock cubes and uncooked spaghetti. Gradually press the spaghetti into the liquid. Add lemon zest and juice. Cook until the liquid is almost completely gone (takes about 15 minutes).
Wash the spinach, add to the pan and cook briefly. Season to taste with salt and pepper.