Convenient one-liner for me because several apps were breaking and depending on 3 different electron versions. This command handled it in one swoop.
This explicitly installs electron19 during the upgrade and retains and upgrades the (will now be upgraded to 20*) package electron.
As @dalto stated, the package named simply electron is always the latest.
And just to add method-to-the-madness logic, think of python as well. Python is another example when you may need multiple versions of said pkg to satisfy deps across your system. I'm sure many of us have been bitten by the python.