In a large bowl, whisk together flour, granulated sugar, brown sugar, baking powder, baking soda, salt, cinnamon, nutmeg, and ginger.
In another bowl, beat eggs, then add grated carrots, vegetable oil, crushed pineapple, and vanilla extract. Mix well.
Gradually add the dry ingredients to the wet ingredients, stirring until just combined.
Fold in chopped walnuts and raisins if using.
Prepare the pressure cooker by greasing silicone cupcake molds or an appropriate baking pan that fits.
Pour the batter evenly into the cupcake molds or pan.
Add 1 cup of water to the pressure cooker pot, place the trivet, then place the cupcake molds on top.
Seal the lid and cook on high pressure for 22 minutes. After cooking, perform a quick release.
Remove cupcakes from molds and let cool completely before frosting with cream cheese frosting made by beating cream cheese, butter, powdered sugar, and vanilla extract.
Notes
Store cupcakes in an airtight container. Enjoy at room temperature or chilled for a refreshing treat.