Slotted ALOHA based schemes with successive interference cancellation adopting techniques from the coding theory literature provide significant throughput improvements over the classical slotted ALOHA. In this work, we extend this approach to the case of energy harvesting. Specifically, we propose a repetition based frame slotted ALOHA scheme assuming energy harvesting nodes. By considering a binary energy harvesting channel in which the energy arrivals are Bernoulli random variables, we conduct an asymptotic analysis and optimize the distribution of the number of packet repetitions. We demonstrate through numerical examples that such an optimization results in significant increases in the maximum system throughput compared to the existing solutions (designed for systems without energy harvesting).