Create a project in Angular
- Type following command to create a new project:
# ng new <PROJECT-NAME>
It will ask “Would you like to add Angular routing? (y/N)” – Type y and hit Enter
On the next step, it will ask “Which stylesheet format would you like to use?” – Select the relevant one, I suggest using CSS.
- To build your app and serve it locally, go to the newly created project folder and use the following command:
# ng serve - To build and open the project directly in the browser, use the following command:
# ng serve -o
You will see the message “Compiled successfully”
You can see default port no:4200
- You will be able to access the new angular project locally using the URL: http://localhost:4200/.
- Once you open this URL, you will see the default homepage.
Run project in Forever using PM2
Install PM2 first on the server using the following command:
# npm install -g pm2
Run the following command to run your project in forever using PM2
# pm2 start “ng serve” –name <PROJECT-NAME>
Ready to Solve Your Most Complex Technical Challenges?
Our senior advisors are ready to help you navigate the ever-evolving technology landscape with precision and expertise.
Schedule a ConsultationRelated Articles
Install NodeJs and Angular CLI
How to Install NodeJs and Angular CLI Steps for installing NodeJS Open https://nodejs.org/ Download the LTS version and install it. ( *LTS…
Firebase hosting setup for Angular app
1. Firstly install node.js on your machine. # sudo apt-get install nodejs # sudo apt-get install npm 2. To install the firebase…
Create PWA for Angular6 Application
Install latest version of Angular CLI using this command: # npm install -g @angular/cli OR # npm install -g @angular/cli@latest Create a…