In nodejs, modules can be roughly divided into core modules and file modules.
The core module is compiled into binary code, and only requires the require indicator when referencing it, such as (require('net')).
File module refers to js file, json file or .node file. When referencing the file module, add the file path: /.../.../xxx.js represents the absolute path, ./xxx.js represents the relative path (xxx.js in the same folder), . ./ represents the upper-level directory. If neither /.../, ../ nor ./ is added, the module is either a core module or loaded from a node_modules folder.
When neither ./ ../ /.../ is specified when loading the module, the search path for loading the module. If the file in '/home/ry/projects/foo.js' calls require('bar.js'), node will search in the following locations: