Timeline for How do I resolve "Cannot find module" error using Node.js?
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 28, 2022 at 8:23 | comment | added | Hotelsinger | Where is the package.json file? Can someone provide more context? I've been using VS Code for a year and have successfully written all kinds of coding projects, but I'm new to NodeJS, and need a step by step on how to fix this very frustrating issue. Everything else I've tried right on this page does not work, or there just isn't enough context. | |
Sep 17, 2019 at 10:37 | comment | added | Mark Birbeck | Thanks for this. I had this situation whilst using Yarn workspaces, so was looking all over for path resolution algorithms and all sorts. :) I was thrown by the way the error message talks of 'locating' the module, and also that ESLint was giving similar error messages. And then I saw your answer and realised I was a dimwit. Thanks! | |
Feb 26, 2019 at 11:13 | comment | added | Dragos |
Very much this. I had managed to point the main entry for my submodule in a directory that was excluded from its repository so when I tried to include it via npm install it worked, but no exports were found when required in! Many thanks for this obvious but useful answer.
|
|
Dec 21, 2017 at 10:00 | comment | added | Jamon Holmgren | Holy cow...out of desperation I typed in "Error: Cannot find module" into google, and found this question. Your answer fixed my problem. I can't believe such a vague search term turned up the right answer. Kudos to you and to Google! | |
Aug 25, 2016 at 8:53 | review | Late answers | |||
Aug 25, 2016 at 8:54 | |||||
Aug 25, 2016 at 8:37 | history | answered | ukosteopath | CC BY-SA 3.0 |