Command not found when running scripts

Problem

"Command not found" (“spawn ENOENT”, “No such file or directory”) appears for node(or any other executable) when running my NPM script

Cause

The error indicates that the process can't be run because the executable can't be found in your $PATH. On UNIX systems the environment variables differ between GUI applications and within the terminal. Terminal environment is only available to applications started from the terminal.

Resolution

MacOS: to solve this problem, WebStorm tries to load the terminal environment on startup. Seems that it can't retrieve all needed stuff in your case for some reason. Please see the corresponding KB article for troubleshooting.

Linux: 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), so the environment (including $PATH) is different from the one you have in terminal. 

Possible solutions: 

  1. make required variables available in a login shell by moving them to the corresponding shell profile config 
  2. run IDE from a terminal to make it inherit terminal environment 
  3. edit IDE desktop launcher and set command to /bin/bash -l -i -c "/path/to/webstorm.sh"
0 out of 0 found this helpful

Please sign in to leave a comment.

Have more questions?

Submit a request