How to mark a directory as library root?

Viewed 15085

I've 2 projects in PhpStorm: one is working well while another won't work and I can't figure what make the first one working.

The first one is working well with library root for bower, npm and composer :

enter image description here

The second one is bower, npm are not detected as library root : enter image description here

So the behaviour in PhpStorm is different, when I use the navigate file on second project, I see all the vendor file by default :

enter image description here

If I mark the directory as excluded, the ide don't understand the vendor class : enter image description here

So how can we configure the IDE to mark a directory as library root ?

3 Answers

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

  • 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.

Related