Execute a Shell Script provides a pristine vanilla shell
(not the customized one used by Terminal.app)
so you need to specify the full path to the executable.
Path in Shell Scripts [Keyboard Maestro Wiki]
use the incantation:
which npx
(from Terminal.app)
to find the full path.
See also: