{"id":14553,"date":"2022-01-31T08:55:59","date_gmt":"2022-01-31T08:55:59","guid":{"rendered":"https:\/\/linuxways.net\/?p=14553"},"modified":"2022-01-31T08:55:59","modified_gmt":"2022-01-31T08:55:59","slug":"install-node-js-17-npm-on-debian-11-bullseye","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/install-node-js-17-npm-on-debian-11-bullseye\/","title":{"rendered":"Install Node.js 17 &amp; NPM on Debian 11 Bullseye"},"content":{"rendered":"<p>Node.js is an open-source and cross platform Javascript framework. JavaScript is a popular programming language for building web applications. Node.js allows frontend developers using JavaScript to build the backend without using a different programming language. NPM is a software package manager for NodeJS that allows developers to share useful JavaScript libraries and packages.<\/p>\n<p>In this guide you will learn how to install Node.JS &amp; NPM on Debian 11.<\/p>\n<h2><strong>Option 1: Install Node.js &amp; NPM from Debian repository<\/strong><\/h2>\n<p>Node.js and npm are available in the default debian repositories. They can simply be installed with the commands:<\/p>\n<pre><strong>$ sudo apt update<\/strong><\/pre>\n<p>Using the APT package manager, install NodeJS and NPM as follows:<\/p>\n<pre><strong>$ sudo apt install nodejs npm<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"881\" height=\"214\" class=\"wp-image-14554\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-680.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-680.png 881w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-680-300x73.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-680-768x187.png 768w\" sizes=\"auto, (max-width: 881px) 100vw, 881px\" \/><\/strong><\/p>\n<p>This install Node.JS alongside a bunch of libraries and dependencies. This might take a while and it\u2019s advisable that you have a good internet connection.<\/p>\n<h2><strong>Option 2: Install Node.js from source<\/strong><\/h2>\n<p>You can build and compile Node.js from source. This is the best option if you wish to install a specific version of Node.js. In this step we are going to install Node.js from source. First, add the repository to Debian 11 with the command:<\/p>\n<pre><strong>$ curl -fsSL https:\/\/deb.nodesource.com\/setup_17.x | sudo -E bash -<\/strong><\/pre>\n<p>Here\u2019s an snippet of the output. The seup script add the GPG signing key and proceeds to create a sources list file for the Node.JS repository in the <strong>\/etc\/apt\/sources.list<\/strong> file.<\/p>\n<p>Then it updates the package index to sync with the newly appended Node.JS repository.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"902\" height=\"590\" class=\"wp-image-14555\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-681.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-681.png 902w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-681-300x196.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-681-768x502.png 768w\" sizes=\"auto, (max-width: 902px) 100vw, 902px\" \/><\/p>\n<p>At the tail-end of the output, you are provided with the next steps to take &#8211; which is to install Node.JS and NPM.<\/p>\n<p>So, go ahead and install Node.JS 17 and npm with the command:<\/p>\n<pre><strong>$ sudo apt install nodejs<\/strong><\/pre>\n<p>As before, this installs NodeJS alongside a bucketload of other libraries and dependencies. To confirm NodeJS is installed, run:<\/p>\n<pre><strong>$ node \u2014-version<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"528\" height=\"108\" class=\"wp-image-14556\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-682.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-682.png 528w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-682-300x61.png 300w\" sizes=\"auto, (max-width: 528px) 100vw, 528px\" \/><\/strong><\/p>\n<p>Also, you can verify npm version as shown.<\/p>\n<pre><strong>$ npm \u2014-version<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"462\" height=\"105\" class=\"wp-image-14557\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-683.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-683.png 462w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-683-300x68.png 300w\" sizes=\"auto, (max-width: 462px) 100vw, 462px\" \/><\/strong><\/p>\n<p>If you are interested in installing Yarn package manager, first add the GPG key<\/p>\n<pre><strong>$ curl -sL https:\/\/dl.yarnpkg.com\/debian\/pubkey.gpg | gpg --dearmor | sudo tee \/usr\/share\/keyrings\/yarnkey.gpg &gt;\/dev\/null<\/strong><\/pre>\n<p>Then add the Yarn repository to the sources list file.<\/p>\n<pre><strong>$ echo \"deb [signed-by=\/usr\/share\/keyrings\/yarnkey.gpg] https:\/\/dl.yarnpkg.com\/debian stable main\" | sudo tee \/etc\/apt\/sources.list.d\/yarn.list<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"902\" height=\"186\" class=\"wp-image-14558\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-684.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-684.png 902w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-684-300x62.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-684-768x158.png 768w\" sizes=\"auto, (max-width: 902px) 100vw, 902px\" \/><\/p>\n<p>Finally, update the package index to refresh the repositories<\/p>\n<pre><strong>$ sudo apt-get update<\/strong><\/pre>\n<p>Thereafter, as instructed, install Yarn using APT package manager.<\/p>\n<pre><strong>$ sudo apt install yarn<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"893\" height=\"227\" class=\"wp-image-14559\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-685.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-685.png 893w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-685-300x76.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/01\/word-image-685-768x195.png 768w\" sizes=\"auto, (max-width: 893px) 100vw, 893px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>This wraps up our guide. Have fun developing your applications with Node.JS<\/p>","protected":false},"excerpt":{"rendered":"<p>Node.js is an open-source and cross platform Javascript framework. JavaScript is a popular programming language for building web applications. Node.js allows frontend developers using JavaScript to build the&hellip;<\/p>","protected":false},"author":1,"featured_media":14562,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[521,259,651],"class_list":["post-14553","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian","tag-debian-11","tag-node-js","tag-npm"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/14553","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=14553"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/14553\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/14562"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=14553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=14553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=14553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}