Node Interpreter: node (No executable found in $PATH)

Answered

Trying to execute simple JaveScript code in IntelliJ IDEA:

 

 

 

When I try to run it brings up the Edit configuration window.

 

I click on the ... and then the + sign to add a local, but I can't find the node.

I do have the Node.js and Node.js Remote Interpreter plugins installed and enabled.

My IDEA application installed in the default location: /usr/local/bin/

But I can't see node there.

I can see the hidden files.

How might I be able to find the node?

 

I also have a similar error when trying to use the "JavaScript for Beginners" course on for the Learn and Teach plugin.

Your help is greatly appreciated!

9 comments
Comment actions Permalink

You need to install node.js itself and have a binary on the system that you can run from the terminal: https://nodejs.org/en/ .

0
Comment actions Permalink

Thank you Serge!

I really appreciate it!

The code runs.

For others out there, I went to the link above, clicked on one of the downloads, installed it.

It showed the default location as /usr/local/bin/node and I accepted.

Once it finished installing, I checked the Languages and Frameworks for Node.js and NPM and it had already updated the Node interpreter with the file path. 

0
Comment actions Permalink

If it works with the regular installer, it means Webstorm is incompatible with NVM. Node is installed via NVM and on the PATH, but Webstorm has some sort of dependency on the official installer.

0
Comment actions Permalink

@Jason Tiscione No, it doesn't seem to have any relation to having Node.js installed with NVM

0
Comment actions Permalink

The problem I'm having is that all the features in the Run menu are broken.

Node is on the PATH. If I open up the Terminal tab and type "which node" it prints the location of the current executable in NVM. If I type echo $PATH I can see it. But if I create a node or npm run target, the "Node Interpreter" dropdown says "node: NO EXECUTABLE FOUND IN PATH".

So I try specifying the absolute path to the NVM folder's node executable in the dropdown instead. But if I try to run it, it still crashes and complains that node is not on the PATH:

"/home/jason/.nvm/versions/node/v12.18.0/bin/node /home/jason/.nvm/versions/node/v12.18.0/lib/node_modules/npm/bin/npm-cli.js start
npm WARN lifecycle npm is using /home/jason/.nvm/versions/node/v12.18.0/bin/node but there is no node binary in the current PATH."

/usr/bin/env: ‘node’: No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! the-nextjs-starter@1.0.0 start: `nodemon server.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the the-nextjs-starter@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/jason/.npm/_logs/2020-07-09T18_39_03_936Z-debug.log

Process finished with exit code 1

So I try copy/paste of the command line that Webstorm claims to be running. It works with no problems, both inside and outside Webstorm's terminal. So this is obviously a bug in Webstorm.

I tried downgrading to 2019.3.3 but that version is also broken.

0
Comment actions Permalink

Try starting WebStorm from terminal using bin/webstorm.sh - does the issue persist?

When being launched from desktop/System menu/Toolbox, WebStorm only sees environment variables configured in login shell, but not in interactive shell configuration files (like .bashrc or .zshrc). Possible solutions:

  • Workaround 1: make required variables available in a login shell by moving them to the corresponding shell profile config
  • Workaround 2: run IDE from a terminal to make it inherit terminal environment

see also https://youtrack.jetbrains.com/issue/IDEABKL-7589

0
Comment actions Permalink

Workaround 1 is not possible with NVM, since it makes its changes to .bashrc.

Workaround 2 does work- if I actually type in "/bin/sh /home/jason/.local/share/JetBrains/Toolbox/apps/WebStorm/ch-0/201.8538.32/bin/webstorm.sh" it works correctly. But that makes Toolbox seem pretty useless.

0
Comment actions Permalink

So no other solutions?

0

Please sign in to leave a comment.