You can, though the flavour won’t be the same. You can boil the pumpkin instead of roasting it.