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.

loadNodeModules() should be more clear about what went wrong

See original GitHub issue

I had an error loading a library, but all it told me is that it couldn’t resolve the module. That’s fine, but the real issue is that the package’s main file didn’t exist.

Here’s some payload information:

{ x: 'snabbdom-view',
  start: '/Users/krainboltgreene/Code/krainboltgreene/deushack/source/client/cycle',
  dirs: [] }

We can definitely make this better. We can say all the directories we looked in, what exact file we;'re looking for (in this case main) and then do some reading to show the user that it’s the package;'s fault.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
krainboltgreenecommented, Nov 2, 2020

As the maintainer of a big project i feel that.

1reaction
ljharbcommented, Oct 29, 2020

@krainboltgreene yes, potentially - there are tools that rely on the exact string and type of an error that resolve throws in specific situations. I’ve broken angular-cli and ember-cli before by changing an error message, and am not anxious to repeat it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to clean up node modules? - Mario Kandut
There are two ways to clean up the node_modules folder: ... Though, operation is not always normal as it should be and crashes...
Read more >
How do I resolve "Cannot find module" error using Node.js?
This happens when a first npm install has crashed for some reason (SIGINT of npm), or that the delay was too long, or...
Read more >
Top 10 Most Common Node.js Developer Mistakes - Toptal
Some of these mistakes degrade performance, while others make Node. js appear straight out unusable for whatever you are trying to achieve.
Read more >
How to clean node modules folder of packages that are not in ...
Now I want to clean node_modules folder so that only modules listed in package.json stay there and the rest must go, something like...
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
To fix the error, you need to install the package that is absent in your project directory – npm install package-name or yarn...
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