Node configuration inside IDEA
The node_module folder should be marked as a library.
To enable code completion for Node.js APIs, go to Preferences | Languages & Frameworks | Node.js and npm and click Enable.
See: