{"id":5587,"date":"2023-12-02T11:28:45","date_gmt":"2023-12-02T11:28:45","guid":{"rendered":"https:\/\/natsav.com\/blog\/?p=5587"},"modified":"2024-01-30T12:38:08","modified_gmt":"2024-01-30T12:38:08","slug":"install-node-js-on-cyberpanel","status":"publish","type":"post","link":"https:\/\/natsav.com\/blog\/install-node-js-on-cyberpanel\/","title":{"rendered":"A Step-by-Step Guide on Installing Node.js on CyberPanel"},"content":{"rendered":"<p><strong>Step 1: Access Your CyberPanel Dashboard<\/strong><\/p>\n<p>Begin by logging into your CyberPanel dashboard. Ensure that you have the necessary credentials and access rights to make server-level changes.<\/p>\n<p><strong>Step 2: Navigate to &#8216;Terminal&#8217;<\/strong><\/p>\n<p>Once logged in, locate the &#8216;Terminal&#8217; option in your CyberPanel dashboard. This is where we&#8217;ll execute the commands to install Node.js.<\/p>\n<p><strong>Step 3: Update the <a href=\"https:\/\/natsav.com\/cyber-panel-vps.php\">Server<\/a><\/strong><\/p>\n<p>Before installing Node.js, it&#8217;s essential to update your server to ensure you have the latest packages. Execute the following command:<\/p>\n<div class=\"bg-black rounded-md\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-bash\">sudo yum update<br \/>\n<\/code><\/div>\n<\/div>\n<p>This command will update all the installed packages on your server.<\/p>\n<p><strong>Step 4: Install Node.js Using NVM (Node Version Manager)<\/strong><\/p>\n<p>Node Version Manager (NVM) is a handy tool that allows you to manage multiple Node.js versions on your server. Install NVM by running the following commands:<\/p>\n<div class=\"bg-black rounded-md\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 dark:bg-token-surface-primary px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-bash\">curl -o- https:\/\/raw.githubusercontent.com\/nvm-sh\/nvm\/v0.38.0\/install.sh | bash<br \/>\n<\/code><\/div>\n<\/div>\n<p>After the installation, close and reopen your terminal or run:<\/p>\n<div class=\"bg-black rounded-md\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 dark:bg-token-surface-primary px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-bash\"><span class=\"hljs-built_in\">source<\/span> ~\/.bashrc<br \/>\n<\/code><\/div>\n<\/div>\n<p><strong>Step 5: Verify NVM Installation<\/strong><\/p>\n<p>Ensure NVM is installed correctly by checking its version:<\/p>\n<div class=\"bg-black rounded-md\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 dark:bg-token-surface-primary px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-bash\">nvm --version<br \/>\n<\/code><\/div>\n<\/div>\n<p>This command should return the version number, confirming the successful installation.<\/p>\n<p><strong>Step 6: Install Node.js<\/strong><\/p>\n<p>Now that NVM is in place, you can easily install Node.js. Run the following command to install the latest LTS version:<\/p>\n<div class=\"bg-black rounded-md\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 dark:bg-token-surface-primary px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-bash\">nvm install --lts<br \/>\n<\/code><\/div>\n<\/div>\n<p>This command installs the Long-Term Support (LTS) version of Node.js.<\/p>\n<p><strong>Step 7: Verify Node.js Installation<\/strong><\/p>\n<p>Confirm that Node.js is installed by checking its version:<\/p>\n<div class=\"bg-black rounded-md\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 dark:bg-token-surface-primary px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-bash\">node --version<br \/>\n<\/code><\/div>\n<\/div>\n<p>This command should display the version number of the Node.js runtime.<\/p>\n<p><strong>Step 8: Install npm (Node Package Manager)<\/strong><\/p>\n<p>npm is the default package manager for Node.js. Install it by running:<\/p>\n<div class=\"bg-black rounded-md\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 dark:bg-token-surface-primary px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-bash\">npm install -g npm<br \/>\n<\/code><\/div>\n<\/div>\n<p>This command installs npm globally on your system.<\/p>\n<p><strong>Step 9: Test Node.js and npm<\/strong><\/p>\n<p>Create a simple test file, for example, <code>test.js<\/code>, with the following content:<\/p>\n<div class=\"bg-black rounded-md\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 dark:bg-token-surface-primary px-4 py-2 text-xs font-sans justify-between rounded-t-md\">javascript<\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-javascript\"><span class=\"hljs-variable language_\">console<\/span>.<span class=\"hljs-title function_\">log<\/span>(<span class=\"hljs-string\">\"Node.js is installed and working!\"<\/span>);<br \/>\n<\/code><\/div>\n<\/div>\n<p>Execute the file using the command:<\/p>\n<div class=\"bg-black rounded-md\">\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-bash\">node test.js<br \/>\n<\/code><\/div>\n<\/div>\n<p>If everything is set up correctly, you should see the output: &#8220;Node.js is installed and working!&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Step 1: Access Your CyberPanel Dashboard Begin by logging into your CyberPanel dashboard. Ensure that you have the necessary credentials and access rights to make server-level changes. Step 2: Navigate to &#8216;Terminal&#8217; Once logged in, locate the &#8216;Terminal&#8217; option in your CyberPanel dashboard. This is where we&#8217;ll execute the commands to install Node.js. Step 3: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5588,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[260],"tags":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/natsav.com\/blog\/wp-content\/uploads\/2023\/12\/nodejs.png?fit=550%2C270&ssl=1","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/posts\/5587"}],"collection":[{"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/comments?post=5587"}],"version-history":[{"count":3,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/posts\/5587\/revisions"}],"predecessor-version":[{"id":5591,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/posts\/5587\/revisions\/5591"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/media\/5588"}],"wp:attachment":[{"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/media?parent=5587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/categories?post=5587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/natsav.com\/blog\/wp-json\/wp\/v2\/tags?post=5587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}