← back to home

How to make RubyMine exclude node_modules from indexing and search

By Ole Ingemann Kjørmo, Jan 28, 2022

When I started working with the new static site generator BridgetownRB, I had to include the node modules folder in my project. This is a requirement as BridgetownRB is using the package manager Yarn or NPM. As I still wanted to write code in RubyMine, I got into a problem when RubyMine started indexing the huge node_module folder. RubyMine would then hang and go into not-responding mode. As of newer versions of RubyMine, I think this is a non-issue. For us with an older version ( < 6.3 ), here is how to solve it:

  • Delete the node_modules folder completely.
  • Create the folder again manually.
  • Open RubyMine and identify the folder.
  • Right click the folder in the folders tree, and click “Mark directory as —> Excluded”
  • It will now disappear from the tree.
  • Run yarn install again. RubyMine should now behave fine.
← back to oleingemann.com

This is where a douchier person would write copyright. Don't copy directly, or I will have to crush you.