People are divided on this issue. Of course, you can have it both ways if you want. You can sell some of your art and you can give some away. But what's the issue in either case? It comes down to what your intentions are.
Naturally, artists are prone to give copies of their work to friends and family, whether that be books or prints or any number of things. But maybe you'd like to give away work for free in order to make a name for yourself or to develop a following.
With electronic media, it's especially easy to do this. You'd obviously be taking a financial hit otherwise, but if you're in a position to do that, more power to you. However, there is an opposite pole to this. If you give too much away fo free, it could potentially limit the general interest in it because people might assume you don't value your work.
But as I said before, it comes down to your intentions. What are you trying to accomplish? No matter which way you go, it's unlikely that it will happen overnight.
That's why you might as well continually revisit that aspect of your medium you are most in love with. As long as you keep exploring and finding joy in that, you'll never care about failing or succeeding. Your failures and successes will be be determined according to your own personal scale.