Tag Archives: Unable to find module

node.js Cannot find module “XXX” solution

Node. js can’t find a solution for the module XXX.
in order. 1. Check for spelling mistakes.
2. This module is written by myself. Check to see if the path is correct.
3. If it is the imported module. Use the NPM List command to output whether this module exists. 4. Also note that the global module installation directory defaults to users/ user /node_modules below. The module that your project is reading is your installation directory (and probably the two directories are different). So sometimes you don’t have this module, and after you install it, you continue to report that you can’t find the module
The solution is to output the path of your installation module with NPM, find the reading path of the current project, and copy the corresponding module to it