The production of electrons from heavy-flavour hadron decays was measured as a function of transverse momentum (pTainer hidden">) in minimum-bias p–Pb collisions at ainer hidden"> using the ALICE detector at the LHC. The measurement covers the pTainer hidden"> interval 0.5<pT<12 GeV/cainer hidden"> and the rapidity range −1.065<ycms<0.135ainer hidden"> 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 RpPbainer hidden"> was calculated by comparing the pTainer hidden">-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 ainer hidden"> and ainer hidden">. The RpPbainer hidden"> is consistent with unity within uncertainties of about 25%, which become larger for pTainer hidden"> below 1 GeV/cainer hidden">. The measurement shows that heavy-flavour production is consistent with binary scaling, so that a suppression in the high-pTainer hidden"> 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.