"Command not found" error when executing a command

This is the most common error and it may have several causes. In order to detect the cause and solve the issue, follow these steps:

1.- Check where the binaries for node are installed:

# which node
/usr/local/bin/node

If node is not installed in /usr/local/bin or /usr/bin then you must change VS Code Settings in order to use an external shell instead of the integrated terminal that is the default:

  • Go to VS Code Settings -> Features -> Terminal and switch from Integrated to External

2.- Check that yarn or fstore commands are installed globally on your system (/usr/local/bin or /usr/local/bin in Linux and Mac):

# which yarn
/usr/local/bin/yarn

# which fstore
/usr/local/bin/fstore

If node is not installed in /usr/local/bin or /usr/bin then you must change VS Code Settings in order to use an external shell instead of the default integrated terminal:

  • Go to VS Code Settings -> Extensions -> FStore and change paths to yarn and/or fstore bin

3.- Check your shell default environment config:

In Mac OS and Linux systems, there are several shells available to be used and make more comfortable our work. However, VS Code has some issues capturing value for PATH for some shell environments like zsh, fish. In order to allow VS Code to get the right environment, you must set the variables in the shell default config file for the environment.

In the case of zsh you must set PATH in the file .zshenv which should be located in your home folder (create it if doesn't exists). For example, to set VOLTA bin folder in path:

# echo "export VOLTA_HOME=\"\$HOME/.volta\"" >> ~/.zshenv
# echo "export PATH=\"\$VOLTA_HOME/bin:\$PATH\"" >> ~/.zshenv

Last updated