We usually recommend excluding this folder if it is used for auxiliary purposes (running grunt / gulp / karma, etc.). But we cannot exclude it by default, since users developing Node.js applications usually need to have completion / types that allow work for node_modules.
If you want it to be excluded from all your projects by default, just add node_modules to the ' Ignore files and folders ' list in Settings/Editor/File types
Update: from 2016.x, node_modules are automatically excluded by default. The direct dependencies listed in package.json are configured as a JavaScript library to complete
source share