Afaik programs are found in PATH which is an environment variable and sudo -E executes a command with root permissions while preserving the environment of the invoking user (including PATH), thus any command x which is found by which x and can be executed as the current user should be found by sudo -E which x and be executable with sudo -E x.For example, in the case of jhbuild (GNOME dependency resolution and build automation tool) which is installed into $HOME/.local/bin by default) this is not the case. How is this possible?
How is it possible that a command is found without, but not with sudo -E?
sudo
It's likely your sudoers has the secure_path option set and it's overriding the PATH regardless of -E. You can either unset it or exempt specific users from it by adding them to exempt_group. See sudoers(5) for more information.