Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore node_modules in Webstorm when using navigation pop-up

Tags:

webstorm

Is it possible to ignore searching the node_modules folder when using WebStorm's navigation pop-up window (Command + Shift + N)?

This makes it really annoying when wanting to quickly navigate to, for example, the package.json file.

like image 364
inreflection7 Avatar asked Aug 29 '13 14:08

inreflection7


4 Answers

To exclude the directory from being searched via navigation pop-up, pick node_modules directory in Project view, then from mouse context menu:

Mark Directory As -> Excluded

enter image description here

Directory could be restored via Preferences->Directories->Excluded Folders settings

like image 191
Andrei Karpushonak Avatar answered Nov 07 '22 11:11

Andrei Karpushonak


In Webstorm 8, you need to also visit Settings > JavaScript > Libraries and disable Node.js core modules and node_modules. The directory exclusion will then work as before.

like image 35
Aram Kocharyan Avatar answered Nov 07 '22 09:11

Aram Kocharyan


To exclude node_modules/ files from being searched in "Navigate | File..." popup and to avoid indexing node_modules/ folder, please perform these steps:

  1. Mark node_modules/ folder as excluded in Settings | Directories.

  2. Remove "<your project name> node_modules" library in Settings | Languages & Frameworks | JavaScript | Libraries.

like image 23
Sergey.Simonchik Avatar answered Nov 07 '22 09:11

Sergey.Simonchik


To exclude node_modules folder from all projects (only created after that change) you can add this folder to list of standard folders to ignore.

  1. Open PHPStorm, and close current project File > Close Project.
  2. On startup PHPStorm window click "Configure > Settings". enter image description here

  3. Then navigate to Build, Execution, Deployment > Deployment > Options.

  4. Now you can set node_modules or anyone else to exclude by default for all new projects. enter image description here

P.s. Closing the current project is very important. If you do this settings with active project, this will affect only current project.

like image 13
Niklan Avatar answered Nov 07 '22 10:11

Niklan