You can configure patterns to hide files and folders from the explorer and searches.
Open VS User Settings (Main menu: File > Preferences > Settings). This will open the setting screen.
Search for files:exclude in the search at the top.
Configure the User Setting with new glob patterns as needed. In this case, add this pattern node_modules/ then click OK. The pattern syntax is powerful. You can find pattern matching details under the Search Across Files topic.
{ "files.exclude": { ".vscode":true, "node_modules/":true, "dist/":true, "e2e/":true, "*.json": true, "**/*.md": true, ".gitignore": true, "**/.gitkeep":true, ".editorconfig": true, "**/polyfills.ts": true, "**/main.ts": true, "**/tsconfig.app.json": true, "**/tsconfig.spec.json": true, "**/tslint.json": true, "**/karma.conf.js": true, "**/favicon.ico": true, "**/browserslist": true, "**/test.ts": true, "**/*.pyc": true, "**/__pycache__/": true } }
node_modulesto show up on any project. So I would set it globally in User Settings instead.