Error running the Salesforce CLI - env: node: No such file or directory
I updated IntelliJ to version IntelliJ IDEA 2023.1.2 and IlluminatedCloud version 2.2.7.3 and after this I can no longer use the plugin. I am able to execute sfdx commands in the terminal, but whenever I try to use anything from the plugin I get the error “Error running the Salesforce CLI - env: node: No such file or directory“. Even just hovering over the “Tools” and selecting it cause the IDE to crash.
I tried reinstalling sfdx, reinstalling nodeJS and updating brew and still got the same.
Comments (6)
-
repo owner -
repo owner - changed status to open
-
repo owner This information is a bit dated, but the highest voted responses may still work on newer versions of Mac OS X:
https://apple.stackexchange.com/questions/51677/how-to-set-path-for-finder-launched-applications
-
reporter Wow! Launching the IDE through the terminal did the trick. Thanks!
-
repo owner - changed status to resolved
Okay, great. That confirms that it's a Finder/Dock path issue and not an IC2 issue. I'm not as well-versed on Mac as on Windows or Linux, specifically in terms of setting the environment in a way that's picked up by Finder/Dock-launched applications. I think the provided link should help, but if not, my guess is that a quick search should probably turn up a solution. And that's only if you want to start the IDE from Finder/Dock and not from the command-line.
-
repo owner - removed component
Removing component: IntelliJ IDEA (automated comment)
- Log in to comment
Hi. Nothing has changed in the way that IC2 executes the CLI in quite some time. Based on the error message, it sounds like the IDE’s environment isn’t able to find the
node
executable in the system execution path. Since you mentioned brew, I’m assuming you’re on a Mac. Often the path used by brew and similar isn’t available to IDE processes started from the dock. Since you can runsfdx
from the command-line, you can confirm this difference by starting the JetBrains IDE from the command-line as well by runningidea
. That will inherit the command-line’s environment including its execution path. My guess is that will work. If so, and if you wish to start the IDE from the dock instead of the command-line, you will need to ensure thatnode
is available via the execution path for processes started from the dock.Please let me know if that doesn’t help.