WebStorm 8, nvm, lessc

Hi,

I'm running WebStorm 8 on Ubuntu 14.04.
Node is installed using nvm.

My Node path is /home/alex/.nvm/v0.10.29/bin/node (running which node from WS Terminal).

The WS Node interpreter is set up for this path.

Running lessc from the WS Terminal works fine.

When using the lessc compiler configured in WS File Watchers (/home/alex/code/myproject/node_modules/less/bin/lessc), I get the following error in the run window:

/home/alex/code/myproject/node_modules/less/bin/lessc --no-color main.less
/usr/bin/env: node: No such file or directory

Thanks

6 comments
Comment actions Permalink

Does the problem persist when launching WebStorm from terminal? NVM  patches environment variables on terminal startup only. If the IDE is  launched from Terminal, it inherits Terminal environment (including  modified PATH environment variable, added NVM_DIR env var, etc). In that  case, there are normally no problems with running tools, as the IDE sees correct PATH value.
If you're using bash as shell, workaround could be the the following:  edit your WebStorm launcher and set command to "/bin/bash -l -c  "/path/to/webstorm.sh". This command will perform bash login (i.e.  reading your .bashrc/.bash_profile files) and after that will runwebstorm.sh.

0
Comment actions Permalink

Thanks, running WebStorm from Terminal works fine.
I'm using zsh.
I updated the jetbrains-webstorm.desktop in ~/.local/share/applications but after that WebStorm did not start.
I modified the exec entry like this:

Exec="/bin/bash -l -c /opt/WebStorm/bin/webstorm.sh" %f

I also tried to use this in .zshenv:
source ~/.nvm/nvm.sh

0
Comment actions Permalink

The mentioned workaround is only suitable for bash shell... I'm not sure how to fix the issue with zsh:(

0
Comment actions Permalink

Hi Elena! Is there any solution for zsh now?

0
Comment actions Permalink

You can patch the desktop launcher to make sure that zsh is run before WebStorm, like /path/to/zsh -i -c /path/to/webstorm.sh. Or, make required variables available in a login shell configuration by moving them to zprofile, etc.

1
Comment actions Permalink

Hi Elena! I'm using Jetbrains Toolbox utility and I guess it rewrites launcher file every time when system loads. I'm not sure but it seems so. I'll check it later.

0

Please sign in to leave a comment.