{"id":20246,"date":"2023-07-31T12:26:46","date_gmt":"2023-07-31T12:26:46","guid":{"rendered":"https:\/\/linuxways.net\/?p=20246"},"modified":"2024-02-27T06:09:31","modified_gmt":"2024-02-27T06:09:31","slug":"how-to-install-node-debian-12","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/how-to-install-node-debian-12\/","title":{"rendered":"How to install Node Debian 12?"},"content":{"rendered":"<p><strong>Node.js<\/strong> is a popular free-to-use runtime environment that is utilized to run JavaScript code on the server side (independently of a web browser). It is an efficient tool for building web applications as it can handle multiple requests at the same time without getting blocked. Moreover, it is a cross-platform tool that can be run on Windows, macOS as well as various Linux distributions including Debian 12.<\/p>\n<p>This guide will demonstrate different methods for <strong>Node.js <\/strong>installation on Debian 12.<\/p>\n<p><strong>Overview<\/strong><\/p>\n<ul>\n<li><a href=\"#post-20246-_rsulotewng4k\"><strong>How to Install Node.js on Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-20246-_e5sxuvq2fg4o\"><strong>How to Run Node.js Scripts on Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-20246-_bnosg81lryrg\"><strong>How to Access Node.js Shell on Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-20246-_1znekwh0fzxc\"><strong>How to Switch Between Node.js Versions on Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-20246-_cv4apv8jsesb\"><strong>How to Remove Node.js From Debian 12<\/strong><\/a><\/li>\n<li><a href=\"#post-20246-_fa2xlrbaoc8k\"><strong>Final Thoughts <\/strong><\/a><\/li>\n<\/ul>\n<h2><a id=\"post-20246-_rsulotewng4k\"><\/a>How to Install Node.js on Debian 12<\/h2>\n<p>On Debian 12, <strong>Node.js<\/strong> can be installed via:<\/p>\n<ul>\n<li><a href=\"#post-20246-_za33i2sopn2q\"><strong>Default Debian Repository<\/strong><\/a><\/li>\n<li><a href=\"#post-20246-_oxyx3ujmdvmj\"><strong>Installation Script<\/strong><\/a><\/li>\n<li><a href=\"#post-20246-_880wjrithscv\"><strong>NodeSource Repository<\/strong><\/a><\/li>\n<li><a href=\"#post-20246-_4pa8curoolx2\"><strong>Source Code <\/strong><\/a><\/li>\n<li><a href=\"#post-20246-_4nc5wxhdmf4v\"><strong>Node Version Manager <\/strong><\/a><\/li>\n<\/ul>\n<h3><a id=\"post-20246-_za33i2sopn2q\"><\/a>Method 1: Install Node.js on Debian 12 From Default Debian Repository<\/h3>\n<p>The default Debian repository contains numerous software packages including <strong>Node.js <\/strong>for Debian users. It is the simplest way to install <strong>Node.js<\/strong> on Debian 12, but it provides a bit outdated version. You can install <strong>Node.js<\/strong> from the Debian repository by following the given steps:<\/p>\n<p><strong>Step 1: Refresh System Packages<\/strong><\/p>\n<p>First, update the Debian system packages list as:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt update<\/div><\/div>\n<p><strong>Step 2: Install Node.js on Debian 12<\/strong><\/p>\n<p>Then, install the <strong>Node.js<\/strong> package i.e. \u201c<strong>nodejs<\/strong>\u201d on your Debian 12 system as:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> nodejs<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"434\" class=\"wp-image-25535\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-1-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-1-2.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-1-2-300x177.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p><strong>Step 3: Ensure Node.js Installation<\/strong><\/p>\n<p>Finally, check the <strong>Node.js<\/strong> installed version to verify its installation on Debian 12:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">node <span class=\"re5\">--version<\/span><\/div><\/div>\n<p>The output shows the installed outdated version:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"115\" class=\"wp-image-25536\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-2-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-2-2.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-2-2-300x47.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<h3><a id=\"post-20246-_oxyx3ujmdvmj\"><\/a>Method 2: Install Node.js on Debian 12 Using Installation Script<\/h3>\n<p>The official <strong>Node.js<\/strong> provides the <a href=\"https:\/\/github.com\/nodesource\/distributions?tab=readme-ov-file#debian-versions\">installation script<\/a> to automatically install <strong>Node.js<\/strong> along with all dependencies on Debian 12 systems. It is the handy and fastest approach to get the most up-to-date version of <strong>Node.js<\/strong> on Debian 12. Here are the steps:<\/p>\n<p><strong>Step 1: Download and Install Node.js on Debian 12<\/strong><\/p>\n<p>To get the most recent version of <strong>Node.js<\/strong> on your Debian 12 system, execute the given command to automatically install it from the installation script:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">curl <span class=\"re5\">-fsSL<\/span> https:<span class=\"sy0\">\/\/<\/span>deb.nodesource.com<span class=\"sy0\">\/<\/span>setup_21.x <span class=\"sy0\">|<\/span> <span class=\"kw2\">sudo<\/span> <span class=\"re5\">-E<\/span> <span class=\"kw2\">bash<\/span> - <span class=\"sy0\">&amp;&amp;<\/span> <span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> nodejs <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"756\" height=\"433\" class=\"wp-image-25537\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-3-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-3-2.png 756w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-3-2-300x172.png 300w\" sizes=\"auto, (max-width: 756px) 100vw, 756px\" \/><\/p>\n<p><strong>Step 2: Verification <\/strong><\/p>\n<p>Check the installed <strong>Node.js <\/strong>version to ensure that it has been successfully installed on Debian 12:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">node <span class=\"re5\">-v<\/span><\/div><\/div>\n<p>The output shows the <strong>Node.js<\/strong> latest version installed on the system:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"113\" class=\"wp-image-25538\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-4-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-4-2.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-4-2-300x46.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<h3><a id=\"post-20246-_880wjrithscv\"><\/a>Method 3: Install Node.js on Debian 12 From NodeSource Repository<\/h3>\n<p>You can also install <strong>Node.js<\/strong> on Debian 12 from the <a href=\"https:\/\/github.com\/nodesource\/distributions\/wiki\/Repository-Manual-Installation\">NodeSource repository<\/a> by adding it to your system. It is the manual installation method that not only provides the <strong>Node.js<\/strong> latest version but also upgrades it automatically via Debian\u2019s package manager. Check out the given steps to install <strong>Node.js<\/strong> on Debian 12 from the NodeSouce repository:<\/p>\n<p><strong>Step 1: Install Necessary Dependencies <\/strong><\/p>\n<p>First, install the given required dependencies for <strong>Node.js<\/strong> installation on the system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> ca-certificates curl gnupg <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"240\" class=\"wp-image-25539\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-5-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-5-2.png 739w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-5-2-300x97.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/p>\n<p><strong>Step 2: Import NodeSource GPG Key<\/strong><\/p>\n<p>Then, import the NodeSource GPG key to ensure the integrity of<strong> Node.js <\/strong>packages as:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">curl <span class=\"re5\">-fsSL<\/span> https:<span class=\"sy0\">\/\/<\/span>deb.nodesource.com<span class=\"sy0\">\/<\/span>gpgkey<span class=\"sy0\">\/<\/span>nodesource-repo.gpg.key <span class=\"sy0\">|<\/span> <span class=\"kw2\">sudo<\/span> gpg <span class=\"re5\">--dearmor<\/span> <span class=\"re5\">-o<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>keyrings<span class=\"sy0\">\/<\/span>nodesource.gpg<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"112\" class=\"wp-image-25540\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-6-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-6-2.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-6-2-300x46.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p><strong>Step 3: Add NodeSource Repository<\/strong><\/p>\n<p>Next, import\/add the official NodeSource repository to your Debian 12 system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"re2\">NODE_MAJOR<\/span>=<span class=\"nu0\">21<\/span><br \/>\n<span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;deb [signed-by=\/etc\/apt\/keyrings\/nodesource.gpg] https:\/\/deb.nodesource.com\/node_<span class=\"es2\">$NODE_MAJOR<\/span>.x nodistro main&quot;<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">sudo<\/span> <span class=\"kw2\">tee<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>sources.list.d<span class=\"sy0\">\/<\/span>nodesource.list<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"195\" class=\"wp-image-25541\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-7-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-7-2.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-7-2-300x79.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p><strong>Step 4: Update System\u2019s Packages<\/strong><\/p>\n<p>You also need to refresh your Debian system to implement new changes:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt update<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"324\" class=\"wp-image-25542\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-8-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-8-1.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-8-1-300x132.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p><strong>Step 5: Install Node.js on Debian 12<\/strong><\/p>\n<p>Now, utilize the given command the install <strong>Node.js<\/strong> on your Debian 12 system from the official NodeSource repository:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> nodejs<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"448\" class=\"wp-image-25543\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-9-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-9-1.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-9-1-300x183.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<p><strong>Step 6: Ensure Installation <\/strong><\/p>\n<p>Lastly, display the <strong>Node.js<\/strong> version to confirm its installation:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">node <span class=\"re5\">-v<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"113\" class=\"wp-image-25544\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-10-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-10-1.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-10-1-300x46.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<h3><a id=\"post-20246-_4pa8curoolx2\"><\/a>Method 4: Install Node.js on Debian 12 Via Source Code<\/h3>\n<p>The official <strong>Node.js<\/strong> provides the source code for the installation of the latest <strong>Node.js <\/strong>version. This approach directly installs <strong>Node.js <\/strong>on the Debian 12 system from the source code but consumes a lot of users\u2019 time so it is least recommended. You can try out the given instructions for <strong>Node.js<\/strong> installation through its source code:<\/p>\n<p><strong>Step 1: Download Node.js Source Code File<\/strong><\/p>\n<p>First, copy the URL of the latest source package file on the <a href=\"https:\/\/nodejs.org\/en\/download\/current\">official Node.js website<\/a> and download it using the \u201c<strong>wget<\/strong>\u201d command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">wget<\/span> https:<span class=\"sy0\">\/\/<\/span>nodejs.org<span class=\"sy0\">\/<\/span>dist<span class=\"sy0\">\/<\/span>v21.6.2<span class=\"sy0\">\/<\/span>node-v21.6.2.tar.gz<\/div><\/div>\n<p>Here, we are downloading the source code file of the latest <strong>Node.js <\/strong>version i.e. \u201c<strong>v21.6.2<\/strong>\u201d.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"364\" class=\"wp-image-25545\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-11-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-11-1.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-11-1-300x148.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<p>Alternatively, download it directly from the <a href=\"https:\/\/nodejs.org\/en\/download\/current\">official website<\/a>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"774\" height=\"550\" class=\"wp-image-25546\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-12-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-12-1.png 774w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-12-1-300x213.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-12-1-768x546.png 768w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/p>\n<p><strong>Step 2: Extract Source Code File<\/strong><\/p>\n<p>Then, use the \u201c<strong>tar xzf<\/strong>\u201d command followed by the downloaded <strong>Node.js<\/strong> compressed file name to extract it:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">tar<\/span> xzf node-v21.6.2.tar.gz<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"735\" height=\"177\" class=\"wp-image-25547\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-13-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-13-1.png 735w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-13-1-300x72.png 300w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/p>\n<p><strong>Step 3: Install Required Dependencies <\/strong><\/p>\n<p>You also have to install the following dependencies on your Debian system for compiling source code:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> zlib1g-dev libncursesw5-dev build-essential libncurses5-dev libffi-dev libbz2-dev libsqlite3-dev libssl-dev <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"366\" class=\"wp-image-25548\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-14-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-14-1.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-14-1-300x149.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<p><strong>Step 4: Start Configuration Process<\/strong><\/p>\n<p>To configure <strong>Node.js<\/strong> on your system, you need to navigate the extracted directory through the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw3\">cd<\/span> node-v21.6.2<\/div><\/div>\n<p>Then, initiate the configuration process:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">.<span class=\"sy0\">\/<\/span>configure<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"136\" class=\"wp-image-25549\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-15-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-15-1.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-15-1-300x55.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<p><strong>Step 5: Compile and Build Source Code<\/strong><\/p>\n<p>Now, use the below-listed command to start the build process through parallel compilation and create the necessary files for <strong>Node.js<\/strong> installation:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">make<\/span> <span class=\"re5\">-j<\/span> <span class=\"nu0\">3<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"408\" class=\"wp-image-25550\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-16-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-16-1.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-16-1-300x166.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<p><strong>Note:<\/strong> This process will take a few hours to finish\/complete.<\/p>\n<p><strong>Step 6: Install Node.js on Debian 12<\/strong><\/p>\n<p>Finally, you can install <strong>Node.js <\/strong>on your Debian 12 system via the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">make<\/span> <span class=\"kw2\">install<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"735\" height=\"448\" class=\"wp-image-25551\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-17-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-17-1.png 735w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-17-1-300x183.png 300w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/p>\n<p><strong>Step 7: Verification <\/strong><\/p>\n<p>To ensure that Node.js has been installed successfully, check its installed version:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">node <span class=\"re5\">-v<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"111\" class=\"wp-image-25552\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-18-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-18-1.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-18-1-300x45.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<h3><a id=\"post-20246-_4nc5wxhdmf4v\"><\/a>Method 5: Install Node.js on Debian 12 Through Node Version Manager<\/h3>\n<p>The <strong>Node Version Manager<\/strong> (NVM) is a utility that enables users to handle multiple <strong>Node.js<\/strong> versions and easily switch between them on the system. You can use the Node Version Manager to seamlessly install and use various <strong>Node.js<\/strong> versions without interfering with each other. Here are the steps:<\/p>\n<p><strong>Step 1: Download and Install NVM on Debian 12<\/strong><\/p>\n<p>First, you need to download the NVM from <a href=\"https:\/\/github.com\/nvm-sh\/nvm?tab=readme-ov-file\">GitHub<\/a> and install it on your Debian 12 system using the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">curl https:<span class=\"sy0\">\/\/<\/span>raw.githubusercontent.com<span class=\"sy0\">\/<\/span>nvm-sh<span class=\"sy0\">\/<\/span>nvm<span class=\"sy0\">\/<\/span>master<span class=\"sy0\">\/<\/span>install.sh <span class=\"sy0\">|<\/span> <span class=\"kw2\">bash<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"407\" class=\"wp-image-25553\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-19-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-19-1.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-19-1-300x166.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p>After that, type out the below-listed command or restart the terminal to save the changes:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw3\">source<\/span> ~<span class=\"sy0\">\/<\/span>.bashrc<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"94\" class=\"wp-image-25554\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-20-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-20-1.png 739w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-20-1-300x38.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/p>\n<p><strong>Step 2: List Available Node.js Versions <\/strong><\/p>\n<p>You can see all the available <strong>Node.js<\/strong> versions and choose the desired version that you want to install on your Debian 12 system:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"708\" height=\"342\" class=\"wp-image-25555\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-21-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-21-1.png 708w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-21-1-300x145.png 300w\" sizes=\"auto, (max-width: 708px) 100vw, 708px\" \/><\/p>\n<p>Scroll down to view more:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"278\" class=\"wp-image-25556\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-22-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-22-1.png 709w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-22-1-300x118.png 300w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/p>\n<p><strong>Step 3: Install Node.js <\/strong><\/p>\n<p>To install the specific <strong>Node.js<\/strong> version, use the \u201c<strong>nvm install &lt;version&gt;<\/strong>\u201d command and specify the desired version that needs to be installed. Here, we are downloading the \u201c<strong>20.11.1<\/strong>\u201d Node.js version:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">nvm <span class=\"kw2\">install<\/span> 20.11.1<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"238\" class=\"wp-image-25558\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-23-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-23-1.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-23-1-300x97.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p>Similarly, you can install any other <strong>Node.js<\/strong> version, such as the latest \u201c<strong>21.6.2<\/strong>\u201d as seen below:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">nvm <span class=\"kw2\">install<\/span> 21.6.2<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"217\" class=\"wp-image-25559\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-24-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-24-1.png 709w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-24-1-300x92.png 300w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/p>\n<h2><a id=\"post-20246-_e5sxuvq2fg4o\"><\/a>How to Run Node.js Scripts on Debian 12<\/h2>\n<p>The <strong>Node.js scripts<\/strong> are the JavaScript files that are executed via the <strong>Node.js<\/strong> runtime environment. You can write <strong>Node.js<\/strong> scripts using any text editor and save them with the \u201c<strong>.js<\/strong>\u201d extension. Then, you can execute<strong> Node.js<\/strong> scripts via the \u201c<strong>node<\/strong>\u201d command in the terminal.<\/p>\n<p>Follow the given instructions for writing and running <strong>Node.js<\/strong> scripts on Debian 12:<\/p>\n<p>First, create and open the \u201c<strong>test.js<\/strong>\u201d Node.js script in the Nano text editor:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">nano<\/span> test.js<\/div><\/div>\n<p>In the \u201c<strong>test.js<\/strong>\u201d file, write the desired JavaScript code. Here, we are simply adding the following code. The first line will print the \u201c<strong>Hello! Linux Ways!<\/strong>\u201d message on the console and the second line will display the environment information in which the script is running:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">console.log<span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;Hello! Linux Ways!&quot;<\/span><span class=\"br0\">&#41;<\/span>;<br \/>\nconsole.log<span class=\"br0\">&#40;<\/span>process.env<span class=\"br0\">&#41;<\/span>;<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"717\" height=\"282\" class=\"wp-image-25560\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-25-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-25-1.png 717w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-25-1-300x118.png 300w\" sizes=\"auto, (max-width: 717px) 100vw, 717px\" \/><\/p>\n<p>Save and close the file by pressing the \u201c<strong>CTRL + S<\/strong>\u201d and \u201c<strong>CTRL + X<\/strong>\u201d keys respectively.<\/p>\n<p>Then, run the \u201c<strong>test.js<\/strong>\u201d <strong>Node.js<\/strong> script file as:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">node test.js<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"513\" class=\"wp-image-25561\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-26-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-26-1.png 720w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-26-1-300x214.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/p>\n<h2><a id=\"post-20246-_bnosg81lryrg\"><\/a>How to Access Node.js Shell on Debian 12<\/h2>\n<p>The <strong>Node.js shell<\/strong> is the interactive environment where users can run the JavaScript code directly and see the output. You can access the Node.js shell and interact with it on Debian 12 by writing out the below-listed command in the terminal:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">node<\/div><\/div>\n<p>As you can see, the Node.js shell has started:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"135\" class=\"wp-image-25562\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-27-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-27-1.png 739w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-27-1-300x55.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/p>\n<p>Now, you can write the desired JavaScript code here. For instance, we are just printing the following message:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">console.log<span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;Hello! Linux Ways!&quot;<\/span><span class=\"br0\">&#41;<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"150\" class=\"wp-image-25563\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-28-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-28-1.png 739w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-28-1-300x61.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/p>\n<p>Similarly, you can enter other JavaScript code like concatenating strings as:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"st0\">&quot;Linux &quot;<\/span> + <span class=\"st0\">&quot;Ways&quot;<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"717\" height=\"135\" class=\"wp-image-25564\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-29-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-29-1.png 717w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-29-1-300x56.png 300w\" sizes=\"auto, (max-width: 717px) 100vw, 717px\" \/><\/p>\n<p>If you want to exit\/leave the <strong>Node.js<\/strong> shell, run the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">.exit<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"112\" class=\"wp-image-25565\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-30-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-30-1.png 739w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-30-1-300x45.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/p>\n<h2><a id=\"post-20246-_1znekwh0fzxc\"><\/a>How to Switch Between Node.js Versions on Debian 12<\/h2>\n<p>If you have installed multiple <strong>Node.js<\/strong> versions on your Debian 12 system and you want to use the specific version, you can easily switch to it. For this purpose, you have to list the installed <strong>Node.js<\/strong> versions, choose the desired version, and switch to it.<\/p>\n<p>You can list all the installed <strong>Node.js<\/strong> versions as:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">nvm list<\/div><\/div>\n<p>As you can see the current Node.js version is \u201c<strong>v21.4.0<\/strong>\u201d:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"492\" class=\"wp-image-25566\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-31-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-31-1.png 739w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-31-1-300x200.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/p>\n<p>To switch to and use a particular <strong>Node.js<\/strong> version, use the \u201c<strong>nvm use &lt;version&gt;<\/strong>\u201d command and specify the desired version that you want to use. Here, we are switching to the \u201c<strong>v21.6.2<\/strong>\u201d Node.js version:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">nvm use v21.6.2<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"735\" height=\"116\" class=\"wp-image-25567\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-32-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-32-1.png 735w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-32-1-300x47.png 300w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/p>\n<h2><a id=\"post-20246-_cv4apv8jsesb\"><\/a>How to Remove Node.js From Debian 12<\/h2>\n<p>If you do not need <strong>Node.js<\/strong> on your Debian 12 system, you can simply uninstall\/remove it based on the method you have installed. Following are the <strong>Node.js<\/strong> removal methods on Debian 12:<\/p>\n<h3><a id=\"post-20246-_v71auy19y79\"><\/a>If Installed From Debian\/NodeSource Repository or Installation Script<\/h3>\n<p>To uninstall <strong>Node.js<\/strong> that you have installed from the default Debian repository, installation script, or NodeSource repository, use the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> apt remove nodejs <span class=\"re5\">-y<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"447\" class=\"wp-image-25568\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-33-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-33-1.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-33-1-300x182.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p>You also have to remove the NodeSource repository and GPG key from your system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">rm<\/span> <span class=\"re5\">-r<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>sources.list.d<span class=\"sy0\">\/<\/span>nodesource.list <span class=\"sy0\">&amp;&amp;<\/span> <span class=\"kw2\">sudo<\/span> <span class=\"kw2\">rm<\/span> <span class=\"re5\">-r<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>keyrings<span class=\"sy0\">\/<\/span>nodesource.gpg<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"114\" class=\"wp-image-25569\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-34-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-34-1.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-34-1-300x46.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<h3><a id=\"post-20246-_lfcb7zfzfu2x\"><\/a>If Installed From Source Code<\/h3>\n<p>If you have installed Node.js from the source code, use the given command to remove it from the Debian 12 system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">find<\/span> <span class=\"sy0\">\/<\/span>home<span class=\"sy0\">\/<\/span>linuxway <span class=\"re5\">-depth<\/span> <span class=\"re5\">-iname<\/span> <span class=\"st_h\">'node*'<\/span> <span class=\"re5\">-exec<\/span> <span class=\"kw2\">rm<\/span> <span class=\"re5\">-rf<\/span> <span class=\"br0\">&#123;<\/span><span class=\"br0\">&#125;<\/span> \\;<\/div><\/div>\n<p><strong>Note: <\/strong>Make sure to replace \u201c<strong>\/home\/linuxway<\/strong>\u201d with your desired directory path:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"114\" class=\"wp-image-25570\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-35-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-35-1.png 720w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-35-1-300x48.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/p>\n<h3><a id=\"post-20246-_d6fsy3mo7buo\"><\/a>If Installed Using Node Version Manager(NVM)<\/h3>\n<p>If Node.js is installed through NVM on your system, you can remove its specific version via the \u201c<strong>nvm uninstall &lt;version&gt;<\/strong>\u201d command. However, if you want to uninstall the current version, you have to deactivate it first and then you can remove it.<\/p>\n<p>You can check out the currently used version as:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">nvm current<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"112\" class=\"wp-image-25571\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-36-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-36-1.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-36-1-300x46.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<p>Then, deactivate the current version by utilizing the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">nvm deactivate<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"111\" class=\"wp-image-25572\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-37-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-37-1.png 738w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-37-1-300x45.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/p>\n<p>Finally, uninstall the specific <strong>Node.js<\/strong> version through the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">nvm uninstall v21.6.2<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"115\" class=\"wp-image-25573\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-38-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-38-1.png 737w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/07\/word-image-20246-38-1-300x47.png 300w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/p>\n<p>That was all about the installation and usage of <strong>Node.js<\/strong> on Debian 12.<\/p>\n<h2><a id=\"post-20246-_fa2xlrbaoc8k\"><\/a>Final Thoughts<\/h2>\n<p>You can install <strong>Node.js <\/strong>on Debian 12 from the default Debian repository, installation script, NodeSource repository, source code, or Node Version Manager. Among all these methods, the installation script and NodeSource repository methods provide the latest and up-to-date version of <strong>Node.js<\/strong> on the Debian 12 system. Other than this, the Node Version Manager method allows you to install numerous <strong>Node.js<\/strong> versions and also switch to the desired version. This guide has explained various methods to install, use, and remove Node.js on Debian 12.<\/p>","protected":false},"excerpt":{"rendered":"<p>To install node.js on Debian 12, you simply need to update your system, install curl, add the NodeSource PPA, and finally install Node.js along with npm.<\/p>","protected":false},"author":110,"featured_media":20369,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-20246","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/20246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=20246"}],"version-history":[{"count":1,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/20246\/revisions"}],"predecessor-version":[{"id":25557,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/20246\/revisions\/25557"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/20369"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=20246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=20246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=20246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}