As I understand SharePoint 2019 on-prem supports older version of SPFx and dependencies. So I need to hold two dev environments if I want to make webparts/extensions for both on-prem and online SharePoint editions?
Can You please send me working versions for SharePoint 2019. Or maybe somewhere is step-by-step how to?
You can use 2 versions on same machine and create 2 different projects for 2019 and Online.
It is recommended to create different Dev environments.
Supported SharePoint Framework version for the SharePoint 2019 is SPFx v1.4.1.
SPFx With SharePoint 2019 might help you in case of SharePoint 2019.
Hope it helps.