Webstorm not inferring nodejs path

Hey guys,

I am nearly at the point of getting insane. Every time I launch webstorm via Alfred, Spotlight or directly, it doesn't infer my PATH vars. This results in the nodejs path missing. My workaround is to close webstorm again and open it with "webstorm ." in the terminal. 

I already tried to set the path in the following files (and all together):

  • .profile
  • .zprofile
  • .bash_profile
  • .zshenv
  • .zshrc

This yield in no result. I use fnm for node version management which forks just fine for every other app (like vscode etc). 

export PATH=/usr/local/bin/:$PATH
eval "$(fnm env --use-on-cd)"

This should totally work, because the PATH gets set with this and fnm is definitely available.  

I still don't get why the intelli ideas don't have proper support for any node version management. 

Any idea for this? I don't want to hard link the node executable.

4 comments
Comment actions Permalink

I'm not sure fnm is supposed to work in GUI apps (i.e. in those apps that aren't started from terminal); to examine the environment variables that are effective when you start the app from desktop, etc., you can follow the guidance in this Ask Ubuntu answer

0
Comment actions Permalink

fnm just adds the bin directory of the current node version to the path and removes the older ones. This worked a few versions ago. Sadly the ask ubuntu link doesn't help me, because I am on macOS. In the integrated terminal it works just fine btw. 

0
Comment actions Permalink

what IDE version do you use? We have a known issue with loading shell environment on Mac in 2022.1 -  IDEA-289094. Do you have any additional logging (iTerm2 shell integration, for example) configured in your shell profile?

1
Comment actions Permalink

This seems to be the issue. Removed the iterm integration and it instantly worked. 

Build #WS-221.4906.8, built on March 3, 2022

Replacing the integration with

test -n "${ITERM_SESSION_ID}" && test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"

worked.

 

1

Please sign in to leave a comment.