Cut the pumpkin flesh into small dice, place them on a sheet of baking parchment and enclose them in a foil parcel. Bake in a preheated oven at 180°C for about 25 minutes, then blend the pumpkin in a food processor until you get a smooth, creamy puree.
In a large bowl, beat the softened butter with the sugar using an electric whisk until soft; add the eggs, one at a time, and mix again with the whisks. Finally, fold in the pumpkin puree.
Sift the flour with the baking powder, salt and bicarbonate of soda, then add the dry ingredients to the rest of the mixture, running the electric whisks again for a few seconds so that the batter is completely smooth.
Grease and flour muffin moulds (unless they are made of silicone or you are using paper cases) and pour in the batter until each mould is three-quarters full.
Bake the cupcakes in a preheated oven at 180°C for about 20 minutes; still perform the skewer test before taking them out of the oven.
While the cupcakes are cooling, prepare the frosting by mixing the cream cheese and icing sugar together with a silicone spatula. Transfer the mixture into a piping bag with a large, round nozzle and leave to rest in the fridge for about an hour.
Decorate the cupcakes by creating ghosts with the frosting; place the chocolate drops to form the eyes and mouth and serve.