{"id":6160,"date":"2018-12-25T22:20:34","date_gmt":"2018-12-25T22:20:34","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=6160"},"modified":"2018-12-28T22:55:30","modified_gmt":"2018-12-28T22:55:30","slug":"how-to-install-node-js-with-npm-on-centos-7","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/12\/25\/how-to-install-node-js-with-npm-on-centos-7\/","title":{"rendered":"How to install Node.js with npm on CentOS 7"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linux4one.com\/wp-content\/uploads\/2018\/11\/How-to-install-Node.jpg\" alt=\"How to install Node.js with npm on CentOS 7\" width=\"750\" height=\"350\" \/>How to install Node.js with npm on CentOS 7<\/p>\n<h2>Install Node.js with npm on CentOS<\/h2>\n<p>In this tutorial, we are going to learn how to install Node.js with npm on CentOS. Node.js is the opensource JavaScript Run-time environment for server-side execution of JavaScript code. Node.js built on Chrome\u2019s V8 JavaScript engine so it can be used to build different types of server-side application.<\/p>\n<p>Where npm stands for Node Package Manager which is the default package manager for Node.js. npm is the worlds largest software registry for Node.js packages with thousands of packages available.<\/p>\n<p>in this tutorial we will install Node.js in following two ways:<\/p>\n<ol>\n<li>Install Node.js and npm using EPEL repository<\/li>\n<li>Install Node.js and npm using nvm<\/li>\n<\/ol>\n<h3>Prerequisites<\/h3>\n<p>Before you start to install Node.js and npm on CentOS 7. You must have the non-root user account on your server with sudo privileges.<\/p>\n<h3>1. Install Node.js and npm using EPEL repository<\/h3>\n<p>First you will need to add NodeSource yum repository on your system. Add it by using curl running following command.<\/p>\n<p>curl -sL https:\/\/rpm.nodesource.com\/setup_10.x | sudo bash &#8211;<\/p>\n<p><u>NOTE : The latest LTS version of Node.js is 10.x if you want to install 8.x version then just replace setup_10.x with setup_8.x<\/u><\/p>\n<p>After executing above command NodeSource repository is enabled. Now you can install Node.js by using the following command. When it will prompt you to retrieve GPG key just press \u2018y\u2019 to continue.<\/p>\n<p>sudo yum install nodejs<\/p>\n<p>Now confirm the installation of Node.js by using the following command<\/p>\n<p>node &#8211;version<\/p>\n<p>And confirm npm installation with the following command<\/p>\n<p>npm &#8211;version<\/p>\n<h3>2. Install Node.js and npm using NVM<\/h3>\n<p>NVM stands for Node Version Manager which is used to manage multiple Node.js versions. If you want to install or uninstall different versions of Node.js then NVM is there for you.<\/p>\n<p>First, we will install NVM (Node Package Manager) on your system. So download NVM installation script running the following command.<\/p>\n<p>curl -o- https:\/\/raw.githubusercontent.com\/creationix\/nvm\/v0.33.11\/install.sh | bash<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/lxer.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"How to install Node.js and npm using nvm on CentOS 7\" width=\"807\" height=\"126\" \/>How to install Node.js and npm using nvm on CentOS 7<\/p>\n<p>As shown in the above output you should close and reopen terminal.<\/p>\n<p>Check nvm version and confirm installation typing<\/p>\n<p>node &#8211;version<\/p>\n<p>Now install Node.js by using the following command.<\/p>\n<p>nvm install node<\/p>\n<p>Verify Node.js installation by typing<\/p>\n<p>node &#8211;version<\/p>\n<p>The output should be:<\/p>\n<p>Output<\/p>\n<p>v10.14.0<\/p>\n<p>You can install multiple versions of Node.js. To do so type following:<\/p>\n<p>nvm install 8.14nvm install &#8211;ltsnvm install 11.3<\/p>\n<p>To list all the versions installed run following command.<\/p>\n<p>nvm ls<\/p>\n<p>You can change the current default version of Node.js by using the following command.<\/p>\n<p>nvm use 8.14<\/p>\n<p>To uninstall a Node.js version type following command<\/p>\n<p>nvm uninstall 11.14<\/p>\n<h3>Conclusion<\/h3>\n<p>You have successfully learned how to install Node.js with npm on CentOS 7. If you have any queries regarding this please don\u2019t forget to comment below.<\/p>\n<p><a href=\"http:\/\/lxer.com\/module\/newswire\/ext_link.php?rid=264180\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to install Node.js with npm on CentOS 7 Install Node.js with npm on CentOS In this tutorial, we are going to learn how to install Node.js with npm on CentOS. Node.js is the opensource JavaScript Run-time environment for server-side execution of JavaScript code. Node.js built on Chrome\u2019s V8 JavaScript engine so it can be &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/12\/25\/how-to-install-node-js-with-npm-on-centos-7\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to install Node.js with npm on CentOS 7&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6160","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/6160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=6160"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/6160\/revisions"}],"predecessor-version":[{"id":6783,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/6160\/revisions\/6783"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=6160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=6160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=6160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}