I'm running Manjaro, I have node in PATH, it's located at /usr/bin/node
and I can invoke it from the terminal using node
, as expected. But when I try to add the interpreter to WebStorm, when I open the dialog for adding Node & npm executables and navigate to /usr/bin
, it simply doesn't show up there. I've installed WebStorm through flatpak. Any ideas?

- 158,824
- 45
- 388
- 391

- 1,933
- 2
- 15
- 32
-
21) https://www.reddit.com/r/Fedora/comments/ioyfrl/jet_brains_ide_users/ -- "These don't work because **flatpaks sandbox them**. They can't use anything on the system (like `/usr/bin/node`)" 2) https://github.com/flathub/com.jetbrains.IntelliJ-IDEA-Ultimate/issues/24 – LazyOne Nov 23 '20 at 10:06
-
2Sadly cannot find a thread/link now where it is discussed in details on how it all works (as far as I remember it was a ticket on Flatpak GitHub about git/docker/node usage from inside the IDE/another tool and why only some work. As far as I remember (which I may be wrong right now) it was because it either has to be explicitly allowed/granted ... or it came bundled with the package). – LazyOne Nov 23 '20 at 10:20
-
1Check comments in [this IDEA-189485 ticket](https://youtrack.jetbrains.com/issue/IDEA-189485) -- they will clarify some things for you , e.g. https://youtrack.jetbrains.com/issue/IDEA-189485#focus=Comments-27-3191881.0-0 – LazyOne Nov 23 '20 at 13:27
3 Answers
Managed to fix this by uninstalling the flatpak
WebStorm instance that I had installed and installed WebStorm through Snap store. It simply worked afterwards, but I'll keep the question open in case anyone has a better solution.

- 1,933
- 2
- 15
- 32
Flatpak is sandboxed, so it cannot directly run anything that is on the host, outside of the user's home directory.
However, there is a way to get around this, by having flatpak run the host binary using the flatpak-spawn
.
Solution
1. Run these two commands in shell:
printf '#!/usr/bin/env sh\nflatpak-spawn --host node "$@"\n' > ~/flatpak-node
chmod a+x ~/flatpak-node
2. In WebStorm, go to
File
> Settings
> Languages & Frameworks
> Node.js and NPM
(or TypeScript
)
and set the Node Interpreter
to ~/flatpak-node
.
Explanation
This will create an executable file called flatpak-node
in your home directory, with this content:
#!/usr/bin/env sh
flatpak-spawn --host node "$@"
This will tell Flatpak to run the node
binary on the host and pass along any parameters. It works because the executable we created is in the home directory, and flatpak-spawn
can run the command as if it was on the host (outside of the sandbox).
Personally, I make the file ~/bin/flatpak-node
, but you can put it anywhere in the home directory.
Bonus PHP
Of note is this same solution works for PhpStorm and the php
interpreter. Simply replace node
with php
in the content and filename:
#!/usr/bin/env sh
flatpak-spawn --host php "$@"

- 2,805
- 2
- 18
- 28
If your WebStorm detects the node interpreter, but won't let you use it via terminal
For anyone stumbling onto this in the future, and your flatpak installation detects a node interpreter (using Shift+F10
works), but using node
or npm
via WebStorm's terminal doesn't work, you may be able to fix that by switching the default terminal in WebStorm from sh
to bash
:
File
> Settings
> Tools
> Terminal
; then set Shell Path
to /bin/bash
If this doesn't work for you (and nor does Sarke's answer), skip to the second part of my answer.
This worked for me, having installed WebStorm via the Pop Shop. Honestly, I'm not sure why that fixes it, nor why WebStorm doesn't automatically use the default shell.
If you've followed Sarke's answer and are still having trouble
If you've followed Sarke's answer (there was no default node interpreter, or you've skipped here from part 1 of my answer) and you're still having trouble, you can follow roughly the same instructions to allow WebStorm to access your entire host terminal:
printf '#!/usr/bin/env sh\nflatpak-spawn --host bash "$@"\n' > ~/flatpak-bash
chmod a+x ~/flatpak-bash
Then set that as your default terminal (using the same instructions from part 1, but with flatpak-bash
), which will allow you to run your entire terminal outside of flatpak's sandbox.
However, by doing so, you'll run into this error, which means you'll lose the ability to terminate programs (i.e. use Ctrl+C
and Ctrl+V
) within WebStorm. In theory, part 3 should solve that problem, though I was unable to get it working myself due to incomplete documentation.
If you've followed the previous part of my answer and are unsatisfied
To avoid this error (i.e. the ability to terminate programs, etc.), you should (in theory) be able to use 1player's host-spawn, which reimpliments flatpak-spawn
and should support termination of programs in WebStorm. To do so, you'll need to "install" host-spawn
(i.e. download a binary, give it execution permissions chmod a+x ~/host-spawn
, move it to ~/bin
), then create a symlink for your chosen shell. Hopefully there is better documentation on its homepage by the time someone finds this, as I was not able to actually get this working myself.

- 23
- 3