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

Node modules may be in parent directories #436

Closed
sveyret opened this issue Oct 31, 2019 · 1 comment
Closed

Node modules may be in parent directories #436

sveyret opened this issue Oct 31, 2019 · 1 comment

Comments

@sveyret
Copy link
Contributor

sveyret commented Oct 31, 2019

Bug Description

When using the bin special parser, the binary module is only looked in current project node_modules folder. But actually, node may also search the module in parent folders. See https://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders

This feature is especially mostly used by yarn workspaces or lerna monorepo.

Versions

  • node -v: any
  • npm -v: any
  • depcheck --version: 0.8.4

Extra info

I already did the correction in my system and will provide a PR. I've just seen that PR #418 seems to give a correction to it, but it is introducing new dependencies while my correction only adds a few lines to bin.js.

rumpl pushed a commit that referenced this issue Nov 1, 2019
* special/bin: climb up directories to find binary module

Issue #436

* Move .gitignore to upper directory

* Remove duplicate test

* Add test for binary packages in parent directories
@rumpl
Copy link
Member

rumpl commented Nov 1, 2019

Closed by #437

@rumpl rumpl closed this as completed Nov 1, 2019
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

2 participants