The production of electrons from heavy-flavour hadron decays was measured as a function of transverse momentum (pT) in minimum-bias p–Pb collisions at grey_pxl.gif" data-inlimgeid="1-s2.0-S0370269315010151-si1.gif"> using the ALICE detector at the LHC. The measurement covers the pT interval 0.5<pT<12 GeV/c and the rapidity range −1.065<ycms<0.135 in the centre-of-mass reference frame. The contribution of electrons from background sources was subtracted using an invariant mass approach. The nuclear modification factor RpPb was calculated by comparing the pT-differential invariant cross section in p–Pb collisions to a pp reference at the same centre-of-mass energy, which was obtained by interpolating measurements at grey_pxl.gif" data-inlimgeid="1-s2.0-S0370269315010151-si116.gif"> and grey_pxl.gif" data-inlimgeid="1-s2.0-S0370269315010151-si126.gif">. The RpPb is consistent with unity within uncertainties of about 25%, which become larger for pT below 1 GeV/c. The measurement shows that heavy-flavour production is consistent with binary scaling, so that a suppression in the high-pT yield in Pb–Pb collisions has to be attributed to effects induced by the hot medium produced in the final state. The data in p–Pb collisions are described by recent model calculations that include cold nuclear matter effects.