How to fix Node interpreter can't been found by intellij, but the node file is in the folder

11.9k Views Asked by At

Intellij can't find my Node.js. If I add it locally the node file isn't visible, but in my file manager node is visible. How can I fix this?

node executable not found in $PATH

node & nodejs are both in the folder

Intellij can't find the file in the correct folder

node verions

I am on Fedora 29. I can run Node.js in my terminal, so I know it is there. Already tried to link the node file with the Node.js file in the terminal. I also tried to run node in visual studio code, but it seems not to work.

I installed node.js and npm with the following command:

 $ sudo dnf install npm nodejs

I expected that a re-installation and a reboot was going to fix it. But Intellij seems not to keep the node file invisible for me.

4

There are 4 best solutions below

2
On BEST ANSWER

In my case running this command fixed the issue.

ln -s "$(which node)" /usr/local/bin/node

The problem is that I need to run this command anytime I Install a new Node version from NVM.

1
On

I reinstalled node from https://nodejs.org/en/ and reopened intellij.

0
On

This issue is very sinister if you are unaware that flatpack apps have a different root directory.

You can fix it without resorting to snaps by selecting node from /run/host/... which is where you should be able to see the host filesystem (if not install Flatseal and enable "All system files" for the IDE).

enter image description here

However in my case it didn't seem to fully work after, as I still get the following error:

enter image description here

1
On

If you have the same Problem in 2023 check that you haven't installed IntelliJ via the fedora flathub (so it's a flatpack). This version is the default in the fedora Store.

It seals the installation in a "sandbox", so it can't access other programs to prevent harm. This leads to IntelliJ not finding node, npm, xmp and corepack.

To get a working version of IntelliJ on Fedora 36/37 and probably also older versions install the snap version.

  1. Uninstall the flatpack

  2. Install snap (https://snapcraft.io/docs/installing-snap-on-fedora)

    sudo dnf install snapd
    sudo ln -s /var/lib/snapd/snap /snap
    
  3. Install IntelliJ Ultimate (https://snapcraft.io/install/intellij-idea-ultimate/fedora)

    sudo snap install intellij-idea-ultimate --classic
    

OR

  1. Install IntelliJ Community Version (https://snapcraft.io/install/intellij-idea-community/fedora)

    sudo snap install intellij-idea-community --classic