Sorry, just making sure I fully understand - when you run npx something
the file opens instead of running? And when running node myWonderfulFile.js
it works correctly?
What OS are you on? Do you have node associated with .js files on your system?
Oh, and - can you try resetting your repo and adding the following line to the top of your executable .js file?
#!/usr/bin/env node