Cook the pasta: Boil spaghetti according to package directions. Reserve ½ cup of pasta water, then drain and set aside.
Sauté veggies: In a large skillet, heat olive oil over medium heat. Add onion and garlic, cook for 2–3 minutes. Add mushrooms and cook for 6–8 minutes until tender and browned.
Add spinach: Stir in spinach and cook until wilted (1–2 minutes).
Make the sauce: Sprinkle the flour over the veggies and stir well to coat. Slowly add plant milk while stirring to avoid lumps. Stir in nutritional yeast, salt, and pepper. Simmer until slightly thickened (3–5 minutes). Add reserved pasta water a little at a time if needed for a looser sauce.
Combine: Add cooked spaghetti to the pan. Toss until coated. Adjust seasoning. Add lemon juice or a pinch of nutmeg if desired.
