How to setup Angular on Ubuntu
Installation steps
1. Install Node.js
Node.js is an open-source server environment that uses JavaScript on the server.
We have to install LTS version as it’s recommended for most users. At this time latest LTS Version: 12.16.1 (includes npm 6.13.4).
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
Latest Node.js LTS version information can be found on the Node.js website.
The installation code depending on the Node.js version can be found on NodeSource which is a Node.js Binary Distributor.
2. Update NPM
Normally, NPM will be installed with the Node.js itself. However, we can update it to the latest version using the below command.
Sometimes it’s optional but I recommend you to do it.
sudo npm install npm@latest -g
3. Install the Angular CLI
sudo npm install -g @angular/cli
Here we’re using sudo
to avoid any permission issues that may occur.
4. Create a workspace and initial Angular application
ng new my-app
5. Run the application
cd my-app
ng serve --open
Now we’re good to go.
Happy Coding!