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.

Npm-check 5.1 is too zealous while looking for missing modules

See original GitHub issue

Hello! First of all, thanks for your work, I love this helper as I love to keep my projects with depencies up to date!

Anyway since updating to 5.1 I noticed an annoying behaviour: npm-check is starting to look for modules everywhere, even in .eslintrc or karma.conf.js!

The worst part is that I use webpack resolve’s modulesDirectories options to load my modules with absolute paths from the root of my project, so I have a lot of this calls:

import Header from 'components/header' or import * as api from 'utils/api'

Before 5.1 they were ignored, while now they are all caught making the report unreadable:

actions                             �  MISSING!  Not installed.
                                        �  PKG ERR!  Not in the package.json. Found in: \src\scripts\actio
ns\animations.js, \src\scripts\actions\blocks.js, \src\scripts\actions\currentConversation.js, \src\script
s\actions\mail.js, \src\scripts\components\Main.jsx...

and so on.

I tried also with the -s flag but it skips a lot of modules so it’s not viable either.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:6
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
alexkuzcommented, Oct 20, 2016

I have similar problems:

  • I’m using custom resolve.modules in webpack config, so there are false positives for such modules. Config looks like this:
resolve: {
        modules: [
          'web_modules',
          'node_modules',
          'shared'
        ]
}

I guess it’s not that easy to support this, though (in this example, it would require checking every nested shared folder in project).

  • Unsupported webpack loaders syntax (like !!style!css?modules!postcss!.). This issue is more common, I believe, and is probably easier to fix: split by !, normalize loader names (style -> style-loader) and then check them, something like that.
0reactions
ramususcommented, Nov 28, 2017

The same here, when using webpack aliases:

    resolve: {
        modules: ['node_modules', 'bower_components'],
        descriptionFiles: ['package.json'],
        extensions: ['.js', '.jsx'],
        alias: {
            libs: path.join(__dirname, 'assets/libs'),
            tests: path.join(__dirname, 'assets/tests'),
            stores: path.join(__dirname, 'assets/stores'),
            components: path.join(__dirname, 'assets/components'),
        },
    },

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error returned when running ncu -g using Windows Terminal
The error occurs whenever I run ncu -g from Powershell or the standard cmd within the Windows Terminal app (not the default command...
Read more >
npm-check
Anyway since updating to 5.1 I noticed an annoying behaviour: npm-check is starting to look for modules everywhere, even in .eslintrc or karma.conf.js...
Read more >
npm install is missing modules - node.js
When I try this It tells me that I have no missing modules, although when I run npm list It is loaded with...
Read more >
npm-check
Works on your globally installed packages too, via -g . ... By default npm-check will look at packages listed as dependencies and ...
Read more >
How To Use Node.js Modules with npm and package.json
The description is very useful when people are searching for your ... If there is no package.json , Node.js will try to load...
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