Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 442 Vote(s) - 3.38 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Node MODULE_NOT_FOUND

#11
I founded this problem too, so I found that I have imported wrong module instead of express module I had imported router module after I had replaced this two my code work as well
Reply

#12
Make sure you are inside the project folder.

Rename the folder "node_modules" to any other name (for example: node_modules_old).

Run command: "npm i" (the command will build new the folder node_modules).

Try running your program again.

If the problem is resolved and your program is running correct, delete the old folder node_modules.
Reply

#13
Haa well, I have spent two days on this and have done everything I can to fix this issue even tried resetting the system but none of them reloved the issue.
And accidentally found out what was causing this issue, it is because of `&` in my parent folder name. File hierarchy `R&D>remix>blog`, When I was trying to run the blog server it was throwing module not found, require stack error.

code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: []

***Solution:*** I have changed the parent folder name to `RnD` and it fixed the issue. If the file name contains any special characters(even parent folders) try updating it. In my case, it is `&`
Reply

#14
The MODULE_NOT_FOUND error happened to me and even running `npm install` the error persisted.

Try to do this
For me, what worked was deleting the node_modules folder

rm -r -f node_modules/

After that, run the command to install the package.json dependencies

npm install

What happened to me was that when I ran `npm install` for the first time I had a very low internet connection and therefore I believe that the packages from package.json were not downloaded correctly and due to that the MODULE_NOT_FOUND error occurred. The funny thing is that just running the npm install command has no effect because it understands that the package is already there but it isn't. Similar as a corrupted data. In my case the npm update was without effect too.
Reply

#15
I had the same kind of error. The problem for me was that I didn't **cd into the right directory**. There was a subfolder inside the project. So, always **check out if you are in the right directory** before running your server.

Hope this helps!
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through