question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

False positivies on app-module-path

See original GitHub issue

While using app-module-path, every required module affected by that is reported as a “missing dependency”.

Missing dependencies
* logger
* config
* services
* lodash

Here, logger and config are actually located under an ./app directory, but the relative path can be omitted thanks to:

require('app-module-path').addPath(__dirname + '/app');

being present at the beginning of the main script. Moreover, services is not even a module. The actual requirements comes from:

const seneca = require('services/seneca');

Can’t say why depcheck reports it that way.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mrchiefcommented, Dec 14, 2016

This package does something really bad - it changes the node.js built-in behavior.

I agree with @lijunle on this one. The extra dots are simple and intuitive. app-module-path not only alter default behaviors and thus breaking any tool chain that rely on default behavior, but it also open up the possibility of abuse and violates the principle of least surprise.

I’d actually vote for not supporting it. If possible, make the support for non-standard things available via plugins. People can opt-in if they choose to do so.

2reactions
ericelliottcommented, Jun 3, 2016

FYI, it’s reporting false positives for modules in NODE_PATH, too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

False positives reported when using yarn instead of npm to ...
I can reproduce the issue when using yarn instead of npm to install the modules. It doesn't make sense to use npm ls...
Read more >
How To Test a Node.js Module with Mocha and Assert
A false-positive is a test case that passes when it should fail. We currently check that the length of the array is not...
Read more >
Resolving require paths with webpack - Stack Overflow
As you see, all my app code lives within a mandatory path namespace. This makes quite clear which require call takes a library,...
Read more >
app-module-path - npm.io
app -module-path. This simple module enables you to add additional directories to the Node.js module search path (for top-level app modules only).
Read more >
npm and distribution path length problems - Adam Lynch
There could easily be false positives. It's one thing having issues locally or within a team, it's a whole other thing to have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found