Preheat your oven to 350°F (175°C). Grease a 9x13-inch baking pan or line it with parchment paper for easier removal.
In a medium bowl, whisk together the flour, baking soda, cinnamon, nutmeg, and salt. Set aside.
In a large mixing bowl, cream together the softened butter, brown sugar, and granulated sugar until light and fluffy.
Add the eggs, one at a time, mixing well after each addition. Stir in the vanilla extract.
Gradually mix the dry ingredients into the wet mixture until just combined.
Gently fold in the grated carrots, crushed pineapple, walnuts, and raisins (if using).
Pour the batter into the prepared baking pan and spread it evenly.
Bake for 25-30 minutes or until a toothpick inserted in the center comes out clean.
While the cookie bars are baking, prepare the frosting by beating the softened cream cheese with the softened butter until smooth. Gradually add the powdered sugar and 1 teaspoon of vanilla extract, mixing until well combined.
Once the cookie bars have cooled completely, spread the cream cheese frosting evenly over the top.
Cut into squares or bars and serve!
Notes
Optional ingredients can be omitted based on preference.