Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No dependencies shown for executable Node.js script w/o any filename extension #181

Open
hiroshi-ishii opened this issue Nov 6, 2024 · 0 comments

Comments

@hiroshi-ishii
Copy link

hiroshi-ishii commented Nov 6, 2024

I have an executable Node.js script (www) with a shebang (#!) which includes foo.js which in turn includes bar.js:
www:

#!/usr/bin/env node
const foo = require("./foo");

foo.js:

const bar = require("./bar");

bar.js

// empty

If I run the dependency-tree CLI on www, I get no dependencies:

$ npx dependency-tree -d . www | jq
{
  "/Users/hiroshi/www": {}
}

If I rename www to www.js, I get the expected result

$ npx dependency-tree -d . www.js | jq
{
  "/Users/hiroshi/www.js": {
    "/Users/hiroshi/foo.js": {
      "/Users/hiroshi/bar.js": {}
    }
  }
}

Environment:

$ npx dependency-tree --version
11.0.1
$ node --version
v18.20.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant