Set up a basic web development environment
A quick guide on which programs should be installed.
If you are new to Angular or web development generally, you may have trouble installing and configuring all the necessary programs. In this guide, we will go through all the steps to set up an optional development environment.
If you are developing on a Windows machine, make sure you use the Linux subsystem, as all commands are for Bash.
The programs for the core of any web development environment are git and node.
If you are using a modern Linux distribution that relies on Ubuntu or macOS, it is very like that
git is already installed. To test if git is already installed, run the command:
If you are using Ubuntu or Debian distribution, you can install
apt-get install git. For other installation methods, see the git download page.
It may be essential to switch between node versions on the fly. Therefore, a classic installation with
apt-get is not a viable option.
To solve this problem, the Node Version Manager project can be used. NVM can be used to install multiple node versions and switch them on the fly. In addition, NVM provides a convenient script for installing the required scripts:
Troubleshooting on Linux
On Linux, after running the install script, if you get
nvm: command not found or see no feedback from your terminal after you type
command -v nvm, close your current terminal, open a new terminal, and try verifying again. Alternatively, you can run the following commands for the different shells on the command line:
These should pick up the
Troubleshooting on macOS
Since OS X 10.9,
/usr/bin/git has been preset by Xcode command line tools, which means we can't properly detect if Git is installed or not. You need to manually install the Xcode command-line tools before running the install script. Otherwise, it'll fail. (see #1782)
If you get
nvm: command not found after running the install script, one of the following might be the reason:
- Since macOS 10.15, the default shell is
zshand nvm will look for
.zshrcto update, none is installed by default. Create one with
touch ~/.zshrcand rerun the install script.
- If you use bash, the previous default shell, your system may not have a
.bash_profilefile where the command is set up. So firstly, create one with
touch ~/.bash_profileand rerun the install script. Then, run
source ~/.bash_profileto pick up the
- You have previously used
bash, but you have
zshinstalled. You need to add these lines manually add
- You might need to restart your terminal instance or run
. ~/.nvm/nvm.sh. Restarting your terminal/opening a new tab/window, or running the source command will load the command and the new configuration.
- If the above didn’t help, you might need to restart your terminal instance. Try opening a new tab/window in your terminal and retry.
If the above doesn’t fix the problem, you may try the following:
- If you use bash, it may be that your
~/.profile) does not source your
~/.bashrcproperly. You could fix this by adding
source ~/<your_profile_file>to it or follow the next step below.
- Try adding the snippet from the install section that finds the correct nvm directory and loads nvm to your usual profile (
- For more information about this issue and possible workarounds, please refer here.