{"id":10195,"date":"2021-08-26T07:42:38","date_gmt":"2021-08-26T04:42:38","guid":{"rendered":"https:\/\/kifarunix.com\/?p=10195"},"modified":"2024-03-18T18:39:11","modified_gmt":"2024-03-18T15:39:11","slug":"install-nodejs-debian-11","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-nodejs-debian-11\/","title":{"rendered":"Install Nodejs on Debian 11"},"content":{"rendered":"\n<p>In this tutorial, you will learn how to install Nodejs on Debian 11.&nbsp;<a href=\"https:\/\/nodejs.org\/en\/about\/\" target=\"_blank\" rel=\"noreferrer noopener\">Nodejs<\/a>&nbsp;is a JavaScript runtime built on&nbsp;<a href=\"https:\/\/v8.dev\/\" target=\"_blank\" rel=\"noreferrer noopener\">Chrome\u2019s V8 JavaScript engine<\/a>&nbsp;and is designed to build scalable network applications.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Nodejs on Debian<\/h2>\n\n\n\n<p>Nodejs is available on the default Debian 11 main repos. However, the available versions may not be up-to-date.<\/p>\n\n\n\n<p>For example, in the command output below, you can see that Nodejs 12.x is available.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt-cache policy nodejs<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>nodejs:\n  Installed: (none)\n  Candidate: 12.22.5~dfsg-2~11u1\n  Version table:\n     12.22.5~dfsg-2~11u1 500\n        500 http:\/\/security.debian.org\/debian-security bullseye-security\/main amd64 Packages\n     12.21.0~dfsg-5 500\n        500 http:\/\/deb.debian.org\/debian bullseye\/main amd64 Packages<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Nodejs APT Repository<\/h3>\n\n\n\n<p>Therefore, to install the latest, which is Nodejs 16.x, which is the current stable release as per the&nbsp;<a href=\"https:\/\/nodejs.org\/en\/about\/releases\/\" target=\"_blank\" rel=\"noreferrer noopener\">Nodejs releases page<\/a>, you need to install Nodejs Deb repository on Debian 11 by executing the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>curl -sL https:\/\/deb.nodesource.com\/setup_16.x | sudo -E bash -<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Nodejs<\/h3>\n\n\n\n<p>Once the repos are in place, you can now install Nodejs.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install nodejs<\/code><\/pre>\n\n\n\n<p>Get the information about installed version of Nodejs on Debian 11;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt info nodejs<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Package: nodejs\nVersion: 16.8.0-deb-1nodesource1\nPriority: optional\nSection: web\nMaintainer: Ivan Iguaran &lt;ivan@nodesource.com&gt;\nInstalled-Size: 122 MB\nProvides: nodejs-dev, nodejs-legacy, npm\nDepends: libc6 (&gt;= 2.17), libgcc1 (&gt;= 1:3.4), libstdc++6 (&gt;= 4.8), python3-minimal, ca-certificates\nConflicts: nodejs-dev, nodejs-legacy, npm\nReplaces: nodejs-dev (&lt;= 0.8.22), nodejs-legacy, npm (&lt;= 1.2.14)\nHomepage: https:\/\/nodejs.org\nDownload-Size: 26.1 MB\nAPT-Manual-Installed: yes\nAPT-Sources: https:\/\/deb.nodesource.com\/node_16.x bullseye\/main amd64 Packages<\/code><\/pre>\n\n\n\n<p>You can also check installed version of Nodejs on Debian 11;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>node -v<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>v16.8.0<\/code><\/pre>\n\n\n\n<p>Note that the command above also installs NPM along with Nodejs. You can verify by checking the version of installed NPM on Debian 11.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>npm -v<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>7.21.0<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install development tools to build native addons<\/h3>\n\n\n\n<p>If you need to build native Nodejs addons, you need to install some development tools by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install gcc g++ make<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Yarn on Debian 11<\/h3>\n\n\n\n<p>You may also want to install Yarn on Debian 11. To do so, run the command below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -sL https:\/\/dl.yarnpkg.com\/debian\/pubkey.gpg | gpg --dearmor | sudo tee \/usr\/share\/keyrings\/yarnkey.gpg &gt;\/dev\/null\necho \"deb &#91;signed-by=\/usr\/share\/keyrings\/yarnkey.gpg] https:\/\/dl.yarnpkg.com\/debian stable main\" | sudo tee \/etc\/apt\/sources.list.d\/yarn.list\napt update\napt install yarn<\/code><\/pre>\n\n\n\n<p>You can now proceed to build your web applications using Nodejs.<\/p>\n\n\n\n<p>Read more on&nbsp;<a href=\"https:\/\/nodejs.org\/en\/docs\/guides\/getting-started-guide\/\" target=\"_blank\" rel=\"noreferrer noopener\">Nodejs getting started guide<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Other tutorials<\/h3>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-yarn-on-debian-11\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install Yarn on Debian 11<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-php-composer-on-rocky-linux-8\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install PHP Composer on Debian 11<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-lamp-stack-on-rocky-linux-8\/#php-8.0-rocky\" target=\"_blank\" rel=\"noreferrer noopener\">Install PHP 8.0 on Debian 11<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn how to install Nodejs on Debian 11.&nbsp;Nodejs&nbsp;is a JavaScript runtime built on&nbsp;Chrome\u2019s V8 JavaScript engine&nbsp;and is designed to build<\/p>\n","protected":false},"author":3,"featured_media":9382,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121],"tags":[3958,4008,3760,4007,4009],"class_list":["post-10195","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-debian-11","tag-debian-11-nodejs","tag-nodejs","tag-nodejs-debian-11","tag-npm-debian-11-install","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/10195"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=10195"}],"version-history":[{"count":3,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/10195\/revisions"}],"predecessor-version":[{"id":21677,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/10195\/revisions\/21677"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/9382"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=10195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=10195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=10195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}