Preheat oven to 350°F. Prepare a 12-count cupcake pan with a nonstick baking spray or line the wells with cupcake wrappers.
In a small bowl, whisk together the flour, baking soda, salt, cinnamon, ginger, and nutmeg. Set aside.
2 cups all-purpose flour, 2 teaspoons baking soda, 1 teaspoon kosher salt, 2 teaspoons ground cinnamon, ½ teaspoon ground ginger, ¼ teaspoon ground nutmeg
In a large bowl, whisk together the vegetable oil, sugar, and eggs. Add the flour mixture into the sugar mixture, add in the vanilla, and mix until well combined. Fold in the carrots, walnuts, coconut, pineapple, and optional raisins.
1 cup vegetable oil, 1¾ cups granulated sugar, 3 large eggs, 1½ teaspoons pure vanilla extract, 2 cups grated carrots, 1 cup crushed walnuts, ½ cup sweetened shredded coconut, ¼ cup crushed pineapple, ½ cup raisins
Fill the wells or cupcake wrappers ¾ of the way full. Bake for 19-21 minutes, until the tops are golden brown and a toothpick comes out clean. Allow the cupcakes to cool in the pan for 2-3 minutes and then move them to a cooling rack to finish cooling.
Once the cupcakes are cooled completely, prepare the frosting.
In a large bowl, use a hand mixer to cream together the cream cheese, powdered sugar, and vanilla extract. Spread the cupcakes with frosting and top with some crushed walnuts. If the cupcakes will be piped and the frosting is too soft, add another ½ cup of powdered sugar to the frosting and blend it in well.
16 ounces cream cheese, 1½ cups powdered sugar, 1 teaspoon pure vanilla extract, ½ cup crushed walnuts