It is a jurisdiction specific question. In some places you need license(s) just to operate as a business.
In most cases it is better to incorporate and do all the necessary registrations before making sales. But if your product/service doesn't take off as expected then the up-front costs are in vain. Some persons are comfortable with the risks of operating as a sole-trader.