How to set location of global NPM modules in WebStorm?

I use Ubuntu and install Node.js via APT. The global modules go into /usr when installed this way. As per the official NPM website, I correct my command line global module permissions using one of their recommended methods:

Because my modules go into /usr, I opt for option #2, where I choose a different spot to store the global modules, where I do have permission. This fixes the command line "npm install -g" but breaks WebStorm's ability to see them. During the New Project dialog, I can't use create-react-app or express for example.

I looked for an area in Settings to set my new global module location but I couldn't find one.


No way currently. There is a feature request to check npm prefix when searching for global modules, please vote for it: for updates.

But still it should be possible to specify a path to your global create-react-app module when creating a project - doesn't it work fr you?


It sounds like that feature request is exactly what I was looking for. I should make a correction: Through the New Project dialog, express still works, just not create-react-app.

Unfortunately, manually specifying the path to my global create-react-app module does not work:

So it seems this negatively affects me more than I thought it would. Luckily, my current workaround is to just use create-react-app via the terminal to create my app, then open it with WebStorm.


>Unfortunately, manually specifying the path to my global create-react-app module does not work:


please can you recreate the issue and provide your idea.log ( You can put it on a file server and provide a link


I made sure the last thing I did was attempt to create the project and then close the IDE, and this is what my log file looks like after:


does the problem persist if you run WebStorm from your system terminal?


I don't know how to run WebStorm from the system terminal. I used to install the IDEs by extracting from the tar.gz and running the <ide>.sh scripts, but now I use the Toolbox. I explored the ~/.WebStorm folder but I couldn't find any executable to start it.


try searching for in your home dir - it may be smth like `~/.local/share/JetBrains/Toolbox/apps/WebStorm/ch-0/163.12024.17/bin/`. If WebStorm was started via Toolbox'а, you can use `ps aux | grep` command to locate the launcher


Please sign in to leave a comment.