If you want a 1x drivetrain, its best to use a narrow-wide chainring and a rear derailleur with a clutch. Otherwise the chain might come off frequently. If you dont mind that, eg if this is your old commuter bike, you can just take the front derailleur off.
Alternatively, if its a problem with the cable, could you run it differently, eg in external housing or use longer ferrules to guide it?