`npx .` does not execute the bin script from my local package

28 Views Asked by At

Sadly I was not able to find input to my problem anywhere on the internet. I am currently dabbling around with npx and want to debug my bin script before pushing it to a registry. What I found out is that it should be possible to execute the bin script of you local package.json by running npx ..

My bin script is very simple at this point and only consists of the following

#!/usr/bin/env node

console.log("Awesome Command");

If I do this however I only see the a short (understandable as it is only a local package at this point) loading animation and then nothing. I would expect my console.log to show up.

If I run the script directly throgh node index.js it logs as expected.

When I look at my local .npm/_npx directory everything looks as I would expect it to. I have one entry with a package.json having a dependency pointing to my local file.

I am runnning node through volta and first suspected that to have something to do with it but if I run /usr/bin/env node the node repl opens with the version installed by volta. So I think this might not be the root cause for my issue.

I am a bit desperate at this point and would appreciate any help or even input on the matter what could be wrong.

0

There are 0 best solutions below