loadNodeModules() should be more clear about what went wrong
See original GitHub issueI 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:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As the maintainer of a big project i feel that.
@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.