{"id":17902,"date":"2024-05-23T16:18:50","date_gmt":"2024-05-23T16:18:50","guid":{"rendered":"https:\/\/hostvento.com\/kb\/web-hosting\/how-to-install-angular-cli-on-centos-rhel-versions-8-7-6\/"},"modified":"2024-06-17T05:50:27","modified_gmt":"2024-06-17T05:50:27","slug":"how-to-install-angular-cli-on-centos-rhel-versions-8-7-6","status":"publish","type":"docs","link":"https:\/\/www.hostvento.com\/kb\/docs\/hosting-faqs\/how-to-install-angular-cli-on-centos-rhel-versions-8-7-6\/","title":{"rendered":"How to Install Angular CLI on CentOS\/RHEL Versions: 8\/7\/6?"},"content":{"rendered":"\n<p>Angular is a framework that uses TypeScript and HTML to create single-page client apps. It keeps an eye on every component and makes sure it is up to date by routinely searching for updates. Installing the Angular CLI tool on CentOS 8\/7\/6 and RHEL 8\/7\/6 Linux operating systems is covered in this guide.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Installing Node.js<\/h3>\n\n\n\n<p>At first, install node.js on your system. Configure node.js yum repository in your CentOS system and install it using the below commands:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -sL https:\/\/rpm.nodesource.com\/setup_12.x | sudo -E bash -\nsudo yum install nodejs<\/pre>\n\n\n\n<p>Ensure that node.js and NPM are successfully installed on your system with the below commands:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">node --version\nnpm --version<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. Installing Angular\/CLI<\/h3>\n\n\n\n<p>Once you install node.js and npm on your system, install the Angular CLI tool on your system by executing the below command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">npm install -g @angular\/cli<\/pre>\n\n\n\n<p>With this, the latest available Angular CLI version will be installed on your system. For installing specific Angular version run command as below with version number.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">npm install -g @angular\/cli@6 #Angular 6\nnpm install -g @angular\/cli@7 #Angular 7\nnpm install -g @angular\/cli@8 #Angular 8\nnpm install -g @angular\/cli@9 #Angular 9\n\nThe -g above command helps to install the Angular CLI tool globally. This makes it accessible to all users and applications on the system. Angular CLI offers a command ng for command-line operations. With this command, you can check the installed version of ng on your system.\nng --version\n\n\/ \\ _ __ __ _ _ _| | __ _ _ __ \/ ___| | |_ _|\n\/ \u25b3 \\ | '_ \\ \/ _` | | | | |\/ _` | '__| | | | | | |\n\/ ___ \\| | | | (_| | |_| | | (_| | | | |___| |___ | |\n\/_\/ \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_| \\____|_____|___|\n|___\/\n\nAngular CLI: 9.0.7\nNode: 12.16.1\nOS: linux x64\n\nAngular:\n...\nIvy Workspace:\n\nPackage Version\n------------------------------------------------------\n@angular-devkit\/architect 0.900.7\n@angular-devkit\/core 9.0.7\n@angular-devkit\/schematics 9.0.7\n@schematics\/angular 9.0.7\n@schematics\/update 0.900.7\nrxjs 6.5.3<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. Creating New Angular Application<\/h3>\n\n\n\n<p>You can also create a new application for example, hello-angular4 with the help of the Angular CLI tools. Run the following command for this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ng new hello-angular<\/pre>\n\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">...\n...\nadded 1011 packages from 1041 contributors and audited 19005 packages in 55.774s\nfound 0 vulnerabilities\n\nSuccessfully initialized git.<\/pre>\n\n\n\n<p>With this, a directory named hello-angular4 will be created in your current directory along with an application.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Serving Angular Application<\/h3>\n\n\n\n<p>The basic Angular application is ready to serve. Now change the directory to hello-angular4 and run your Angular application with the ng serve command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd hello-angular\nng serve<\/pre>\n\n\n\n<p>Your angular application is now accessible on localhost port 4200, the default host and port used by Angular application.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">http:\/\/localhost:4200<\/pre>\n\n\n\n<p>It is possible to change host and port for running Angular application by providing \u2013host and \u2013port command line arguments.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ng serve --host --port<\/pre>\n\n\n\n<p>In this way, you can install Angular CLI on CentOS\/RHEL versions 8\/7\/6.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Angular is a framework that uses TypeScript and HTML to create single-page client apps. It keeps an eye on every component and makes sure it is up to date by routinely searching for updates. Installing the Angular CLI tool on CentOS 8\/7\/6 and RHEL 8\/7\/6 Linux operating systems is covered in this guide. 1. Installing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":23377,"menu_order":1100,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-17902","docs","type-docs","status-publish","hentry","no-post-thumbnail"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/docs\/17902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/comments?post=17902"}],"version-history":[{"count":1,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/docs\/17902\/revisions"}],"predecessor-version":[{"id":17906,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/docs\/17902\/revisions\/17906"}],"up":[{"embeddable":true,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/docs\/23377"}],"wp:attachment":[{"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/media?parent=17902"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.hostvento.com\/kb\/wp-json\/wp\/v2\/doc_tag?post=17902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}