OSX ships with bash 3 by default, but you need bash 4 to use npx shell auto fallback. Using homebrew:
(instructions borrowed from https://github.com/Homebrew/homebrew-command-not-found)
brew update && brew install bash
# Add the new shell to the list of allowed shells
sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells'
# Change to the new shell
chsh -s /usr/local/bin/bash
Then you can just follow the instructions in the npx README and it should work as intended.