{"id":4907,"date":"2023-07-22T09:25:02","date_gmt":"2023-07-22T09:25:02","guid":{"rendered":"https:\/\/arzhost.com\/blogs\/?p=4907"},"modified":"2023-10-04T14:38:16","modified_gmt":"2023-10-04T14:38:16","slug":"install-node-js-and-npm-on-windows","status":"publish","type":"post","link":"https:\/\/arzhost.com\/blogs\/install-node-js-and-npm-on-windows\/","title":{"rendered":"How to Install node.js and NPM on Windows?"},"content":{"rendered":"<p>How to Install node.js and NPM on Windows? Node.js is a run-time environment that comes with everything you need to run a <strong>JavaScript program<\/strong>. Before content is sent to a web browser, it is used to run programs on the server to render it.<\/p>\n<p>Node Package Manager, or <a href=\"https:\/\/www.npmjs.com\/\">NPM<\/a>, is a tool and repository for creating and exchanging JavaScript code.<\/p>\n<p>This post will assist you in setting up Node.js, NPM, and other helpful Node.js commands on a Windows computer.<\/p>\n<ol>\n<li><code>A user profile with administrative rights (or the ability to download and install software)<\/code><\/li>\n<li><code>Either Windows PowerShell (Search &gt; PowerShell &gt; right-click &gt; run as administrator) OR the ability to use the Windows command line (Search &gt; cmd &gt; right-click &gt; run as administrator)<\/code><\/li>\n<\/ol>\n<h2><strong>How to Install node.js and NPM on Windows Step by Step?<\/strong><\/h2>\n<h3><strong><u>Step 1: Get the Node.js installer.<\/u><\/strong><\/h3>\n<p>Go to https:\/\/nodejs.org\/en\/download\/ via a web browser. To get the most recent default version, use the Windows Installer option. Version 10.16.0-x64 was the most current version at the time this article was written. The NPM package manager is included in the Node.js installer.<\/p>\n<p><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/X-FPCwZFU_8\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<h3><strong><u>Step 2: Download and install NPM and Node.js<\/u><\/strong><\/h3>\n<ol>\n<li>Open the installer after it has finished downloading. Click the file after opening the downloads link in your browser. Alternatively, you can double-click the file by navigating to where you stored it to start it.<\/li>\n<li>Click Run when the system prompts you to run the program.<\/li>\n<li>After being welcomed, click Next to see the Node.js Setup Wizard.<\/li>\n<li>Examine the license agreement on the next screen. If you are ready to install the software and accept the terms, click Next.<\/li>\n<li>The installer will ask you where you want to install it. Click Next after selecting the default location unless you have a reason to install it elsewhere.<\/li>\n<li>You can choose which components to include or leave out of the installation using the wizard. Again, click Next to accept the settings unless you have a compelling need to change them.<\/li>\n<li>To launch the installer, click the Install option. Click Finish when it&#8217;s finished.<\/li>\n<\/ol>\n<h3><strong><u>Step 3: Verify Installation<\/u><\/strong><\/h3>\n<p><u>Launch PowerShell or a command prompt and type the following:<\/u><\/p>\n<ul>\n<li><code>node -v<\/code><\/li>\n<\/ul>\n<p><u>The Node.js version that is currently installed on your machine ought to be visible. The same applies to NPM:<\/u><\/p>\n<ul>\n<li><code>npm \u2013v<\/code><\/li>\n<\/ul>\n<h2><strong>How to Update node.js and NPM on Windows?<\/strong><\/h2>\n<h3><strong><u>Windows<\/u><\/strong><\/h3>\n<p>Node.js can be removed from Windows&#8217; Control Panel.<\/p>\n<p><u>To do this:<\/u><\/p>\n<ol>\n<li><code>Select \"Start\" &gt; \"Settings\" (the gear icon), then \"Apps.\"<\/code><\/li>\n<li><code>Click to highlight Node.js after scrolling down to find it.<\/code><\/li>\n<li><code>Choose Uninstall. This starts the program uninstall wizard.<\/code><\/li>\n<\/ol>\n<h3><strong><u>Simple Node.js Use<\/u><\/strong><\/h3>\n<p>Node.js is a framework, thus it doesn&#8217;t function like a typical application. Instead, it translates the instructions you type. Make a Hello World script to test your new Node.js installation.<\/p>\n<p><u>1: Start by opening your preferred text editor:<\/u><\/p>\n<p><u>2: After that, paste the subsequent content into the text editor you just launched:<\/u><\/p>\n<p style=\"padding-left: 40px;\"><code>var http = require('http');<\/code><\/p>\n<p style=\"padding-left: 40px;\"><code>\u00a0http. create Server (function (req, res) <\/code>{<\/p>\n<p style=\"padding-left: 40px;\">\u00a0<code>\u00a0 res. write Head (200, {'Content-Type': 'text\/html'}<\/code>);<\/p>\n<p style=\"padding-left: 40px;\">\u00a0<code>\u00a0 res. end ('Hello World!'<\/code>);<\/p>\n<p style=\"padding-left: 40px;\"><code>\u00a0}). listen (8080)<\/code>;<\/p>\n<p><u>3: After saving the file, go away. Launch PowerShell and type the following commands:<\/u><\/p>\n<ul>\n<li><code>Users your username&gt; node<\/code><\/li>\n<li><code>js<\/code><\/li>\n<\/ul>\n<p>It will appear that nothing has changed. Your script is actually executing in the background. If Windows Defender displays a warning about permitting traffic, click Allow for the time being.<\/p>\n<p><u>4: After that, launch a browser and type the following into the address bar:<\/u><\/p>\n<ul>\n<li><code>http:\/\/localhost:8080<\/code><\/li>\n<\/ul>\n<p>You should see the words &#8220;Hello World&#8221; in the upper-left corner.<\/p>\n<p>Your computer is currently working as a server. The Hello World message will appear on any other computer that tries to access your system via port 8080.<\/p>\n<p>Switch back to PowerShell and hit Ctrl+C to end the program. The command prompt will appear once more on the computer. This window may be closed anytime you are prepared.<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p><span style=\"color: #000000;\"><strong>How to Install node.js and NPM on Windows?<\/strong> <\/span>Both the Node.js framework and the <strong>NPM package management<\/strong> should now be installable. Additionally, you&#8217;ve created your first JavaScript node.js program!<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Install node.js and NPM on Windows? Node.js is a run-time environment that comes with everything you need to run a JavaScript program. Before content is sent to a web browser, it is used to run programs on the server to render it. Node Package Manager, or NPM, is a tool and repository for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6106,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-4907","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-window"],"_links":{"self":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/4907","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/comments?post=4907"}],"version-history":[{"count":4,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/4907\/revisions"}],"predecessor-version":[{"id":6105,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/4907\/revisions\/6105"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media\/6106"}],"wp:attachment":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media?parent=4907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/categories?post=4907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/tags?post=4907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}