Preheat the oven to 350°F (175°C) and grease a 9x13 inch baking pan.
In a large bowl, whisk together the flour, sugar, baking powder, baking soda, cinnamon, nutmeg, and salt until well combined.
In another bowl, beat together the vegetable oil and eggs until smooth, then add the grated carrots and crushed pineapple. Mix well.
Gently fold the wet ingredients into the dry mixture until just combined. Do not overmix!
If desired, fold in the chopped walnuts for extra texture.
Pour the batter into the prepared baking pan and spread evenly.
Bake for 25-30 minutes, or until a toothpick inserted into the center comes out clean. Let cool in the pan.
For the cream cheese frosting, blend the cream cheese and butter together until creamy. Gradually add the powdered sugar and vanilla extract until smooth.
Once the bars are cooled, spread the frosting evenly over the top. Cut into squares and serve.