Most packages in python or nodejs? Install and run through package managers just fine.
Having a statically linked binary will not always magically solve this, but it's a great step in that direction.
The other step is not relying on any external servers or services, e.g. postgresql, redis, etc.
The rest just boils down to programmer discipline. Never introduce something that can potentially cause a headache to the end user.
If you're building on an interpreted language, you can't really do that. You will always at least require the user to have a specific version of python/node/whatever.
This can get complicated if the user has a different version, so now you have to introduce a virtualization layer that can manage several different versions of the environment. These tools are always annoying to use.
Not to mention that some packages could have native dependencies (e.g. a python library having a dependency on a c library) and this is almost always a source of headaches.
Python and Node interpreters are EXEs that are NOT easy to install and configure for 95+% of end-users
> Inevitably, something breaks because of my machine's particular configuration.
Indeed. Like a screwed up $PYTHONPATH
> On the development side, building to that magical executable is an even bigger nightmare.
I do not understand.
> Most packages in python or nodejs? Install and run through package managers just fine.
This implies you are familiar with WHICH interpreter you are calling and that you know where it is installed so you can call it.
None of this is easy for end-users.
Luckily there are many many useful libraries available with very liberal licenses.
If there is ever something that looks nice and shiny but will invariably cause me grief in getting working, it is written in some interpreted language (Python seems to be a particularly good at messing with me) that want everything to be in some very peculiar way.
And this trend of every new language coming with its own package manager is troubling me, as it means that developers will be even more lax about documenting their dependencies...