How to mark a directory as library root?

Thanks to @LazyOne comment, found the solution : Select Preferences | Languages & Frameworks | JavaScript | Libraries and click Add. Select the path you want to add and the folder will be marked as library root. Really useful for non standard path (not bower_components for example)


  • File > Settings > Directories
  • Remove any node_modules entries (right-hand side, x's)

Thank you to @Allisone for providing the manual solution.

Based on their response, I was able to replicate the solution using the settings.


Found a solution that worked for me.

I opened the .idea folder (in sublime), searched all files for the text node_modules and removed the lines containing it.

In my case I had 2 entries

  • workspace.xml

<property name="ts.external.directory.path" value="$PROJECT_DIR$/node_modules/typescript/lib" />

  • project-name.iml

<content url="file://$MODULE_DIR$/node_modules" />

Now my node_modules directory is automatically marked as library root again