[{"data":1,"prerenderedAt":1710},["ShallowReactive",2],{"en-main-blog_en-\u002Fblog\u002Fapt-install-node-26-on-ubuntu-26":3,"en-alternative-blog_es-\u002Fblog\u002Fapt-install-node-26-on-ubuntu-26":1699},{"id":4,"title":5,"body":6,"date":1696,"description":1697,"extension":1698,"image":1699,"meta":1700,"navigation":767,"path":1701,"schemaOrg":1699,"seo":1702,"stem":1703,"tags":1704,"toc":1708,"updatedAt":1699,"__hash__":1709},"blog_en\u002Fblog\u002F0004.apt-install-node-26-on-ubuntu-26.md","Install Node.js 26 with apt on Ubuntu 26.04",{"type":7,"value":8,"toc":1687},"minimark",[9,21,39,67,72,75,128,143,147,169,192,196,214,246,257,263,291,295,298,303,306,339,342,370,385,389,416,424,428,434,466,481,502,506,514,535,553,557,567,598,602,605,629,641,645,650,665,1587,1591,1594,1655,1666,1680,1683],[10,11,12,13,20],"p",{},"On October 21, 2026, Node.js released ",[14,15,19],"a",{"href":16,"rel":17},"https:\u002F\u002Fnodejs.org\u002Fen\u002Fblog\u002Fvulnerability\u002Foctober-2026-security-releases",[18],"nofollow","security patches"," for ten vulnerabilities affecting its supported versions, four of them rated high, including a remote code execution issue. Unsupported versions, such as Node.js 20 and 25, won't be updated.",[10,22,23,24,28,29,34,35,38],{},"Keeping Node.js up to date isn't optional: it's worth spending some time on it, both on your personal computer and on your server. The easiest way is to let the operating system handle those updates for you. To do that, install Node.js with ",[25,26,27],"code",{},"apt"," from the ",[14,30,33],{"href":31,"rel":32},"https:\u002F\u002Fnodesource.com\u002F",[18],"NodeSource"," repository and let ",[25,36,37],{},"sudo apt upgrade"," take care of the rest.",[10,40,41,42,47,48,52,53,47,58,61,62,66],{},"Now that ",[14,43,46],{"href":44,"rel":45},"https:\u002F\u002Fnodejs.org\u002F",[18],"Node.js 26"," (",[49,50,51],"em",{},"Lithium",") has been LTS since October 28, 2026 and ",[14,54,57],{"href":55,"rel":56},"https:\u002F\u002Fdocumentation.ubuntu.com\u002Frelease-notes\u002F26.04\u002F",[18],"Ubuntu 26.04 LTS",[49,59,60],{},"Resolute Raccoon",") has been out for months, it's a good time to get it properly installed. The recipe is the same as in my ",[14,63,65],{"href":64},"\u002Fblog\u002Finstall-node-24-on-ubuntu-24","Node.js 24 on Ubuntu 24 guide",".",[68,69,71],"h3",{"id":70},"support-dates-at-a-glance","Support dates at a glance",[10,73,74],{},"Both releases have long support windows, so this setup will last for a while:",[76,77,78,97],"table",{},[79,80,81],"thead",{},[82,83,84,88,91,94],"tr",{},[85,86,87],"th",{},"Release",[85,89,90],{},"Released",[85,92,93],{},"LTS \u002F standard support",[85,95,96],{},"End of life",[98,99,100,115],"tbody",{},[82,101,102,106,109,112],{},[103,104,105],"td",{},"Node.js 26 (Lithium)",[103,107,108],{},"May 5, 2026",[103,110,111],{},"Active LTS from Oct 28, 2026",[103,113,114],{},"April 30, 2029",[82,116,117,119,122,125],{},[103,118,57],{},[103,120,121],{},"April 23, 2026",[103,123,124],{},"Standard support until April 2031",[103,126,127],{},"ESM with Ubuntu Pro for 10 years",[10,129,130,131,136,137,142],{},"Node.js 26 moves to maintenance on October 20, 2027 (see the ",[14,132,135],{"href":133,"rel":134},"https:\u002F\u002Fgithub.com\u002Fnodejs\u002FRelease#release-schedule",[18],"official release schedule","), and it's the last release under the odd\u002Feven model: from ",[14,138,141],{"href":139,"rel":140},"https:\u002F\u002Fnodejs.org\u002Fen\u002Fblog\u002Fannouncements\u002Fevolving-the-nodejs-release-schedule",[18],"Node.js 27"," onwards, the project ships one major release per year and every release becomes LTS. If you're still on Node.js 24, don't panic: it's supported until April 2028 (and Node.js 22 until April 2027).",[68,144,146],{"id":145},"what-changed-since-nodejs-24","What changed since Node.js 24",[10,148,149,150,154,155,158,159,164,165,168],{},"Most of the steps are the same, but there is one important change: ",[151,152,153],"strong",{},"Corepack is no longer bundled with Node.js",". It was removed in Node.js 25, so ",[25,156,157],{},"corepack enable"," doesn't work on a fresh Node.js 26 install. The ",[14,160,163],{"href":161,"rel":162},"https:\u002F\u002Fnodejs.org\u002Fdocs\u002Flatest-v25.x\u002Fapi\u002Fcorepack.html",[18],"Node.js docs"," point to the userland ",[25,166,167],{},"corepack"," package if you still want it.",[10,170,171,172,177,178,183,184,186,187,191],{},"I took the simplest route and now install ",[14,173,176],{"href":174,"rel":175},"https:\u002F\u002Fpnpm.io\u002F",[18],"pnpm"," with its own standalone installer. If you use ",[14,179,182],{"href":180,"rel":181},"https:\u002F\u002Fyarnpkg.com\u002F",[18],"Yarn",", you can install the ",[25,185,167],{}," package globally (see ",[14,188,190],{"href":189},"#what-about-yarn","below",").",[68,193,195],{"id":194},"the-easy-way","The easy way",[10,197,198,199,204,205,208,209,66],{},"As before, you can install everything with a single command. The script installs Node.js 26 from NodeSource, configures a global ",[14,200,203],{"href":201,"rel":202},"https:\u002F\u002Fdocs.npmjs.com\u002F",[18],"npm"," prefix (so you don't need ",[25,206,207],{},"sudo"," for global packages), and can optionally install pnpm and ",[14,210,213],{"href":211,"rel":212},"https:\u002F\u002Fbun.sh\u002F",[18],"Bun",[215,216,221],"pre",{"className":217,"code":218,"language":219,"meta":220,"style":220},"language-bash shiki shiki-themes catppuccin-latte catppuccin-mocha","curl -fsSL https:\u002F\u002Fangelblanco.dev\u002Fscripts\u002Fubuntu-install-node-26.sh | bash\n","bash","",[25,222,223],{"__ignoreMap":220},[224,225,228,232,236,239,243],"span",{"class":226,"line":227},"line",1,[224,229,231],{"class":230},"sMmZK","curl",[224,233,235],{"class":234},"sgueU"," -fsSL",[224,237,238],{"class":234}," https:\u002F\u002Fangelblanco.dev\u002Fscripts\u002Fubuntu-install-node-26.sh",[224,240,242],{"class":241},"sjJjI"," |",[224,244,245],{"class":230}," bash\n",[10,247,248,249,253,254,256],{},"The script asks for confirmation at each major step. As always, read ",[14,250,252],{"href":251},"#the-script","the script"," before you pipe it into ",[25,255,219],{},". Running random scripts from the internet is a fun hobby until it isn't.",[10,258,259,260,262],{},"If you don't have ",[25,261,231],{}," installed:",[215,264,266],{"className":217,"code":265,"language":219,"meta":220,"style":220},"sudo apt update\nsudo apt install curl\n",[25,267,268,278],{"__ignoreMap":220},[224,269,270,272,275],{"class":226,"line":227},[224,271,207],{"class":230},[224,273,274],{"class":234}," apt",[224,276,277],{"class":234}," update\n",[224,279,281,283,285,288],{"class":226,"line":280},2,[224,282,207],{"class":230},[224,284,274],{"class":234},[224,286,287],{"class":234}," install",[224,289,290],{"class":234}," curl\n",[68,292,294],{"id":293},"the-step-by-step-guide","The step-by-step guide",[10,296,297],{},"Here's what the script does, in case you want to run it step by step.",[299,300,302],"h4",{"id":301},"_1-update-dependencies-and-add-the-nodesource-repository","1. Update dependencies and add the NodeSource repository",[10,304,305],{},"First, install the tools needed to download and verify packages:",[215,307,309],{"className":217,"code":308,"language":219,"meta":220,"style":220},"sudo apt update\nsudo apt install -y ca-certificates curl gnupg\n",[25,310,311,319],{"__ignoreMap":220},[224,312,313,315,317],{"class":226,"line":227},[224,314,207],{"class":230},[224,316,274],{"class":234},[224,318,277],{"class":234},[224,320,321,323,325,327,330,333,336],{"class":226,"line":280},[224,322,207],{"class":230},[224,324,274],{"class":234},[224,326,287],{"class":234},[224,328,329],{"class":234}," -y",[224,331,332],{"class":234}," ca-certificates",[224,334,335],{"class":234}," curl",[224,337,338],{"class":234}," gnupg\n",[10,340,341],{},"Then add the NodeSource repository for Node.js 26:",[215,343,345],{"className":217,"code":344,"language":219,"meta":220,"style":220},"curl -fsSL https:\u002F\u002Fdeb.nodesource.com\u002Fsetup_26.x | sudo -E bash -\n",[25,346,347],{"__ignoreMap":220},[224,348,349,351,353,356,358,361,364,367],{"class":226,"line":227},[224,350,231],{"class":230},[224,352,235],{"class":234},[224,354,355],{"class":234}," https:\u002F\u002Fdeb.nodesource.com\u002Fsetup_26.x",[224,357,242],{"class":241},[224,359,360],{"class":230}," sudo",[224,362,363],{"class":234}," -E",[224,365,366],{"class":234}," bash",[224,368,369],{"class":234}," -\n",[10,371,372,373,376,377,380,381,384],{},"NodeSource uses a single ",[25,374,375],{},"nodistro"," suite for every Debian-based distribution, so it works on Ubuntu 26.04 without waiting for a codename-specific repository. The setup script also adds an apt pin with priority ",[25,378,379],{},"600",", so the NodeSource package always wins over the ",[25,382,383],{},"nodejs"," package from the Ubuntu archive. Without it, you could end up with an older Node.js from the Ubuntu repositories.",[299,386,388],{"id":387},"_2-install-nodejs-and-npm","2. Install Node.js and npm",[215,390,392],{"className":217,"code":391,"language":219,"meta":220,"style":220},"sudo apt-get install -y nodejs\nnode --version\n",[25,393,394,408],{"__ignoreMap":220},[224,395,396,398,401,403,405],{"class":226,"line":227},[224,397,207],{"class":230},[224,399,400],{"class":234}," apt-get",[224,402,287],{"class":234},[224,404,329],{"class":234},[224,406,407],{"class":234}," nodejs\n",[224,409,410,413],{"class":226,"line":280},[224,411,412],{"class":230},"node",[224,414,415],{"class":234}," --version\n",[10,417,418,419,421,422,66],{},"This installs both the ",[25,420,412],{}," runtime and ",[25,423,203],{},[299,425,427],{"id":426},"_3-configure-npms-global-prefix","3. Configure npm's global prefix",[10,429,430,431,433],{},"To install global packages without ",[25,432,207],{},", set up a directory in your home folder:",[215,435,437],{"className":217,"code":436,"language":219,"meta":220,"style":220},"mkdir -p ~\u002F.npm-global\nnpm config set prefix '~\u002F.npm-global'\n",[25,438,439,450],{"__ignoreMap":220},[224,440,441,444,447],{"class":226,"line":227},[224,442,443],{"class":230},"mkdir",[224,445,446],{"class":234}," -p",[224,448,449],{"class":234}," ~\u002F.npm-global\n",[224,451,452,454,457,460,463],{"class":226,"line":280},[224,453,203],{"class":230},[224,455,456],{"class":234}," config",[224,458,459],{"class":234}," set",[224,461,462],{"class":234}," prefix",[224,464,465],{"class":234}," '~\u002F.npm-global'\n",[10,467,468,469,472,473,476,477,480],{},"Then add it to your ",[25,470,471],{},"PATH"," in ",[25,474,475],{},"~\u002F.bashrc"," or ",[25,478,479],{},"~\u002F.zshrc",":",[215,482,484],{"className":217,"code":483,"language":219,"meta":220,"style":220},"export PATH=~\u002F.npm-global\u002Fbin:$PATH\n",[25,485,486],{"__ignoreMap":220},[224,487,488,492,496,499],{"class":226,"line":227},[224,489,491],{"class":490},"sAS4m","export",[224,493,495],{"class":494},"s0aCy"," PATH",[224,497,498],{"class":241},"=~",[224,500,501],{"class":494},"\u002F.npm-global\u002Fbin:$PATH\n",[299,503,505],{"id":504},"_4-install-pnpm","4. Install pnpm",[10,507,508,509,480],{},"Since Corepack is no longer included, install pnpm with its ",[14,510,513],{"href":511,"rel":512},"https:\u002F\u002Fpnpm.io\u002Finstallation",[18],"standalone script",[215,515,517],{"className":217,"code":516,"language":219,"meta":220,"style":220},"curl -fsSL https:\u002F\u002Fget.pnpm.io\u002Finstall.sh | sh -\n",[25,518,519],{"__ignoreMap":220},[224,520,521,523,525,528,530,533],{"class":226,"line":227},[224,522,231],{"class":230},[224,524,235],{"class":234},[224,526,527],{"class":234}," https:\u002F\u002Fget.pnpm.io\u002Finstall.sh",[224,529,242],{"class":241},[224,531,532],{"class":230}," sh",[224,534,369],{"class":234},[10,536,537,538,540,541,544,545,548,549,552],{},"The installer adds pnpm to your ",[25,539,471],{}," in your shell config, so open a new terminal (or ",[25,542,543],{},"source"," your config file) before you run ",[25,546,547],{},"pnpm --version",". From then on, ",[25,550,551],{},"pnpm self-update"," keeps it up to date.",[299,554,556],{"id":555},"_5-install-bun-optional","5. Install Bun (optional)",[10,558,559,560,563,564,480],{},"If you want to try ",[14,561,213],{"href":211,"rel":562},[18],", use its official installer, which needs ",[25,565,566],{},"unzip",[215,568,570],{"className":217,"code":569,"language":219,"meta":220,"style":220},"sudo apt install -y unzip\ncurl -fsSL https:\u002F\u002Fbun.sh\u002Finstall | bash\n",[25,571,572,585],{"__ignoreMap":220},[224,573,574,576,578,580,582],{"class":226,"line":227},[224,575,207],{"class":230},[224,577,274],{"class":234},[224,579,287],{"class":234},[224,581,329],{"class":234},[224,583,584],{"class":234}," unzip\n",[224,586,587,589,591,594,596],{"class":226,"line":280},[224,588,231],{"class":230},[224,590,235],{"class":234},[224,592,593],{"class":234}," https:\u002F\u002Fbun.sh\u002Finstall",[224,595,242],{"class":241},[224,597,245],{"class":230},[68,599,601],{"id":600},"what-about-yarn","What about Yarn?",[10,603,604],{},"If your projects use Yarn, you can still use Corepack. You just need to install it yourself:",[215,606,608],{"className":217,"code":607,"language":219,"meta":220,"style":220},"npm install -g corepack\ncorepack enable\n",[25,609,610,622],{"__ignoreMap":220},[224,611,612,614,616,619],{"class":226,"line":227},[224,613,203],{"class":230},[224,615,287],{"class":234},[224,617,618],{"class":234}," -g",[224,620,621],{"class":234}," corepack\n",[224,623,624,626],{"class":226,"line":280},[224,625,167],{"class":230},[224,627,628],{"class":234}," enable\n",[10,630,631,632,634,635,640],{},"Because we configured a global npm prefix, this works without ",[25,633,207],{},". Keep in mind that the ",[14,636,639],{"href":637,"rel":638},"https:\u002F\u002Fgithub.com\u002Fnodejs\u002Fcorepack",[18],"Corepack"," package is now maintained outside the Node.js release cycle, so check its README if something behaves unexpectedly on Node.js 26.",[68,642,644],{"id":643},"the-script","The script",[10,646,647,648,66],{},"This is the complete script. It includes confirmations, uses a temporary directory that is removed on exit, and reads your answers from the terminal, so it works when you pipe it from ",[25,649,231],{},[10,651,652,653,658,659,664],{},"This script comes from my ",[14,654,657],{"href":655,"rel":656},"https:\u002F\u002Fgithub.com\u002Fangelblanco\u002Fkickstart.nvim",[18],"Neovim configuration repo",", where I keep my ",[14,660,663],{"href":661,"rel":662},"https:\u002F\u002Fgithub.com\u002Fangelblanco\u002Fkickstart.nvim\u002Fblob\u002Fmaster\u002Finstall\u002Finstall-node.sh",[18],"install scripts",". The editor needs Node.js for several language servers and plugins, so I update them regularly. If you want the latest version, look there first.",[215,666,669],{"className":217,"code":667,"filename":668,"language":219,"meta":220,"style":220},"#!\u002Fbin\u002Fbash\n#\n# Author: Ángel Blanco\n# License: MIT\n#\n# This script is provided \"as is\", without warranty of any kind. Use at your own risk.\n#\n# Source: https:\u002F\u002Fangelblanco.dev\u002Fblog\u002Fapt-install-node-26-on-ubuntu-26\n#\n# Usage:\n#   curl -fsSL https:\u002F\u002Fangelblanco.dev\u002Fscripts\u002Fubuntu-install-node-26.sh | bash\n#\n# This script installs Node.js and several package managers.\n# Run it as your non-root user: it asks for elevated permissions\n# with sudo when needed.\n#\n\nset -e\n\n# Basic confirmation module before executing the script.\nconfirm_action() {\n    read -p \"$1 (y\u002Fn): \" choice \u003C \u002Fdev\u002Ftty\n    case \"$choice\" in\n        [Yy]|[Yy][Ee][Ss])\n            return 0\n            ;;\n        [Nn]|[Nn][Oo])\n            return 1\n            ;;\n        *)\n            echo \"Invalid choice. Please enter 'y' or 'n'.\"\n            confirm_action \"$1\"\n            ;;\n    esac\n}\n\n# You can configure these variables if needed\nNODE_VERSION=26\nNPM_PREFIX=\"~\u002F.npm-global\"\nDEPS=\"ca-certificates curl gnupg\"\n\nTMP_DIR=$(mktemp -d)\ntrap 'rm -rf \"$TMP_DIR\"' EXIT\n\necho \"This script will install Node.js and optionally other package managers.\"\necho \"\"\n\nif ! confirm_action \"Install Node.js version $NODE_VERSION?\"; then\n    echo \"Skipping Node.js installation. Exiting.\"\n    exit 0\nfi\n\necho \"Installing the dependencies needed to install Node.js...\"\n\nsudo apt update\nsudo apt install -y $DEPS\n\necho \"Installing Node.js...\"\ncurl -fsSL https:\u002F\u002Fdeb.nodesource.com\u002Fsetup_$NODE_VERSION.x -o $TMP_DIR\u002Fnodesource_setup.sh\nsudo -E bash $TMP_DIR\u002Fnodesource_setup.sh\n\nsudo apt-get install -y nodejs\n\nmkdir -p ~\u002F.npm-global\nnpm config set prefix $NPM_PREFIX\necho \"npm prefix set to $NPM_PREFIX\"\n\necho \"Node.js installation completed.\"\necho \"Node version: \"\nnode --version\n\necho \"\"\n\nif confirm_action \"Install pnpm?\"; then\n    echo \"Installing pnpm...\"\n    curl -fsSL https:\u002F\u002Fget.pnpm.io\u002Finstall.sh | sh -\n    echo \"pnpm installation completed. Open a new terminal (or source your shell config) to use it.\"\nfi\n\necho \"\"\n\nif confirm_action \"Install Bun?\"; then\n    echo \"Installing Bun...\"\n    sudo apt install -y unzip\n    curl -fsSL https:\u002F\u002Fbun.sh\u002Finstall | bash\n    export BUN_INSTALL=\"$HOME\u002F.bun\"\n    export PATH=\"$BUN_INSTALL\u002Fbin:$PATH\"\n    echo \"Bun version: \"\n    bun --version\nfi\n\necho \"\"\necho \"Installation process finished.\"\necho \"\"\necho \"Add the global npm bin directory to your PATH by adding this line to your .bashrc or .zshrc:\"\necho 'export PATH=~\u002F.npm-global\u002Fbin:$PATH'\necho \"\"\necho \"Node.js now comes from apt, so keep it patched with:\"\necho \"sudo apt update && sudo apt upgrade\"\necho \"\"\n","ubuntu-install-node-26.sh",[25,670,671,677,683,689,695,700,706,711,717,722,728,734,739,745,751,757,762,769,779,784,790,803,830,847,883,893,899,924,932,937,943,952,965,970,976,982,987,993,1005,1016,1027,1032,1051,1063,1068,1077,1085,1090,1117,1126,1134,1140,1145,1153,1158,1167,1181,1186,1194,1218,1231,1236,1249,1254,1263,1277,1290,1295,1303,1311,1318,1323,1330,1335,1349,1357,1373,1381,1386,1391,1398,1403,1417,1425,1439,1452,1471,1493,1501,1509,1514,1519,1526,1534,1541,1549,1557,1564,1572,1580],{"__ignoreMap":220},[224,672,673],{"class":226,"line":227},[224,674,676],{"class":675},"skWWU","#!\u002Fbin\u002Fbash\n",[224,678,679],{"class":226,"line":280},[224,680,682],{"class":681},"som-u","#\n",[224,684,686],{"class":226,"line":685},3,[224,687,688],{"class":681},"# Author: Ángel Blanco\n",[224,690,692],{"class":226,"line":691},4,[224,693,694],{"class":681},"# License: MIT\n",[224,696,698],{"class":226,"line":697},5,[224,699,682],{"class":681},[224,701,703],{"class":226,"line":702},6,[224,704,705],{"class":681},"# This script is provided \"as is\", without warranty of any kind. Use at your own risk.\n",[224,707,709],{"class":226,"line":708},7,[224,710,682],{"class":681},[224,712,714],{"class":226,"line":713},8,[224,715,716],{"class":681},"# Source: https:\u002F\u002Fangelblanco.dev\u002Fblog\u002Fapt-install-node-26-on-ubuntu-26\n",[224,718,720],{"class":226,"line":719},9,[224,721,682],{"class":681},[224,723,725],{"class":226,"line":724},10,[224,726,727],{"class":681},"# Usage:\n",[224,729,731],{"class":226,"line":730},11,[224,732,733],{"class":681},"#   curl -fsSL https:\u002F\u002Fangelblanco.dev\u002Fscripts\u002Fubuntu-install-node-26.sh | bash\n",[224,735,737],{"class":226,"line":736},12,[224,738,682],{"class":681},[224,740,742],{"class":226,"line":741},13,[224,743,744],{"class":681},"# This script installs Node.js and several package managers.\n",[224,746,748],{"class":226,"line":747},14,[224,749,750],{"class":681},"# Run it as your non-root user: it asks for elevated permissions\n",[224,752,754],{"class":226,"line":753},15,[224,755,756],{"class":681},"# with sudo when needed.\n",[224,758,760],{"class":226,"line":759},16,[224,761,682],{"class":681},[224,763,765],{"class":226,"line":764},17,[224,766,768],{"emptyLinePlaceholder":767},true,"\n",[224,770,772,776],{"class":226,"line":771},18,[224,773,775],{"class":774},"s-0VM","set",[224,777,778],{"class":234}," -e\n",[224,780,782],{"class":226,"line":781},19,[224,783,768],{"emptyLinePlaceholder":767},[224,785,787],{"class":226,"line":786},20,[224,788,789],{"class":681},"# Basic confirmation module before executing the script.\n",[224,791,793,796,800],{"class":226,"line":792},21,[224,794,795],{"class":230},"confirm_action",[224,797,799],{"class":798},"sxyLT","()",[224,801,802],{"class":798}," {\n",[224,804,806,809,811,814,818,821,824,827],{"class":226,"line":805},22,[224,807,808],{"class":774},"    read",[224,810,446],{"class":234},[224,812,813],{"class":234}," \"",[224,815,817],{"class":816},"s2f33","$1",[224,819,820],{"class":234}," (y\u002Fn): \"",[224,822,823],{"class":234}," choice",[224,825,826],{"class":241}," \u003C",[224,828,829],{"class":234}," \u002Fdev\u002Ftty\n",[224,831,833,836,838,841,844],{"class":226,"line":832},23,[224,834,835],{"class":490},"    case",[224,837,813],{"class":234},[224,839,840],{"class":494},"$choice",[224,842,843],{"class":234},"\"",[224,845,846],{"class":490}," in\n",[224,848,850,853,856,859,862,865,867,870,873,875,878,880],{"class":226,"line":849},24,[224,851,852],{"class":798},"        [",[224,854,855],{"class":234},"Yy",[224,857,858],{"class":798},"]",[224,860,861],{"class":798},"|",[224,863,864],{"class":798},"[",[224,866,855],{"class":234},[224,868,869],{"class":798},"][",[224,871,872],{"class":234},"Ee",[224,874,869],{"class":798},[224,876,877],{"class":234},"Ss",[224,879,858],{"class":798},[224,881,882],{"class":241},")\n",[224,884,886,889],{"class":226,"line":885},25,[224,887,888],{"class":490},"            return",[224,890,892],{"class":891},"st0oN"," 0\n",[224,894,896],{"class":226,"line":895},26,[224,897,898],{"class":798},"            ;;\n",[224,900,902,904,907,909,911,913,915,917,920,922],{"class":226,"line":901},27,[224,903,852],{"class":798},[224,905,906],{"class":234},"Nn",[224,908,858],{"class":798},[224,910,861],{"class":798},[224,912,864],{"class":798},[224,914,906],{"class":234},[224,916,869],{"class":798},[224,918,919],{"class":234},"Oo",[224,921,858],{"class":798},[224,923,882],{"class":241},[224,925,927,929],{"class":226,"line":926},28,[224,928,888],{"class":490},[224,930,931],{"class":891}," 1\n",[224,933,935],{"class":226,"line":934},29,[224,936,898],{"class":798},[224,938,940],{"class":226,"line":939},30,[224,941,942],{"class":241},"        *)\n",[224,944,946,949],{"class":226,"line":945},31,[224,947,948],{"class":774},"            echo",[224,950,951],{"class":234}," \"Invalid choice. Please enter 'y' or 'n'.\"\n",[224,953,955,958,960,962],{"class":226,"line":954},32,[224,956,957],{"class":230},"            confirm_action",[224,959,813],{"class":234},[224,961,817],{"class":816},[224,963,964],{"class":234},"\"\n",[224,966,968],{"class":226,"line":967},33,[224,969,898],{"class":798},[224,971,973],{"class":226,"line":972},34,[224,974,975],{"class":490},"    esac\n",[224,977,979],{"class":226,"line":978},35,[224,980,981],{"class":798},"}\n",[224,983,985],{"class":226,"line":984},36,[224,986,768],{"emptyLinePlaceholder":767},[224,988,990],{"class":226,"line":989},37,[224,991,992],{"class":681},"# You can configure these variables if needed\n",[224,994,996,999,1002],{"class":226,"line":995},38,[224,997,998],{"class":494},"NODE_VERSION",[224,1000,1001],{"class":241},"=",[224,1003,1004],{"class":234},"26\n",[224,1006,1008,1011,1013],{"class":226,"line":1007},39,[224,1009,1010],{"class":494},"NPM_PREFIX",[224,1012,1001],{"class":241},[224,1014,1015],{"class":234},"\"~\u002F.npm-global\"\n",[224,1017,1019,1022,1024],{"class":226,"line":1018},40,[224,1020,1021],{"class":494},"DEPS",[224,1023,1001],{"class":241},[224,1025,1026],{"class":234},"\"ca-certificates curl gnupg\"\n",[224,1028,1030],{"class":226,"line":1029},41,[224,1031,768],{"emptyLinePlaceholder":767},[224,1033,1035,1038,1040,1043,1046,1049],{"class":226,"line":1034},42,[224,1036,1037],{"class":494},"TMP_DIR",[224,1039,1001],{"class":241},[224,1041,1042],{"class":798},"$(",[224,1044,1045],{"class":230},"mktemp",[224,1047,1048],{"class":234}," -d",[224,1050,882],{"class":798},[224,1052,1054,1057,1060],{"class":226,"line":1053},43,[224,1055,1056],{"class":774},"trap",[224,1058,1059],{"class":234}," 'rm -rf \"$TMP_DIR\"'",[224,1061,1062],{"class":234}," EXIT\n",[224,1064,1066],{"class":226,"line":1065},44,[224,1067,768],{"emptyLinePlaceholder":767},[224,1069,1071,1074],{"class":226,"line":1070},45,[224,1072,1073],{"class":774},"echo",[224,1075,1076],{"class":234}," \"This script will install Node.js and optionally other package managers.\"\n",[224,1078,1080,1082],{"class":226,"line":1079},46,[224,1081,1073],{"class":774},[224,1083,1084],{"class":234}," \"\"\n",[224,1086,1088],{"class":226,"line":1087},47,[224,1089,768],{"emptyLinePlaceholder":767},[224,1091,1093,1096,1099,1102,1105,1108,1111,1114],{"class":226,"line":1092},48,[224,1094,1095],{"class":490},"if",[224,1097,1098],{"class":241}," !",[224,1100,1101],{"class":230}," confirm_action",[224,1103,1104],{"class":234}," \"Install Node.js version ",[224,1106,1107],{"class":494},"$NODE_VERSION",[224,1109,1110],{"class":234},"?\"",[224,1112,1113],{"class":798},";",[224,1115,1116],{"class":490}," then\n",[224,1118,1120,1123],{"class":226,"line":1119},49,[224,1121,1122],{"class":774},"    echo",[224,1124,1125],{"class":234}," \"Skipping Node.js installation. Exiting.\"\n",[224,1127,1129,1132],{"class":226,"line":1128},50,[224,1130,1131],{"class":774},"    exit",[224,1133,892],{"class":891},[224,1135,1137],{"class":226,"line":1136},51,[224,1138,1139],{"class":490},"fi\n",[224,1141,1143],{"class":226,"line":1142},52,[224,1144,768],{"emptyLinePlaceholder":767},[224,1146,1148,1150],{"class":226,"line":1147},53,[224,1149,1073],{"class":774},[224,1151,1152],{"class":234}," \"Installing the dependencies needed to install Node.js...\"\n",[224,1154,1156],{"class":226,"line":1155},54,[224,1157,768],{"emptyLinePlaceholder":767},[224,1159,1161,1163,1165],{"class":226,"line":1160},55,[224,1162,207],{"class":230},[224,1164,274],{"class":234},[224,1166,277],{"class":234},[224,1168,1170,1172,1174,1176,1178],{"class":226,"line":1169},56,[224,1171,207],{"class":230},[224,1173,274],{"class":234},[224,1175,287],{"class":234},[224,1177,329],{"class":234},[224,1179,1180],{"class":494}," $DEPS\n",[224,1182,1184],{"class":226,"line":1183},57,[224,1185,768],{"emptyLinePlaceholder":767},[224,1187,1189,1191],{"class":226,"line":1188},58,[224,1190,1073],{"class":774},[224,1192,1193],{"class":234}," \"Installing Node.js...\"\n",[224,1195,1197,1199,1201,1204,1206,1209,1212,1215],{"class":226,"line":1196},59,[224,1198,231],{"class":230},[224,1200,235],{"class":234},[224,1202,1203],{"class":234}," https:\u002F\u002Fdeb.nodesource.com\u002Fsetup_",[224,1205,1107],{"class":494},[224,1207,1208],{"class":234},".x",[224,1210,1211],{"class":234}," -o",[224,1213,1214],{"class":494}," $TMP_DIR",[224,1216,1217],{"class":234},"\u002Fnodesource_setup.sh\n",[224,1219,1221,1223,1225,1227,1229],{"class":226,"line":1220},60,[224,1222,207],{"class":230},[224,1224,363],{"class":234},[224,1226,366],{"class":234},[224,1228,1214],{"class":494},[224,1230,1217],{"class":234},[224,1232,1234],{"class":226,"line":1233},61,[224,1235,768],{"emptyLinePlaceholder":767},[224,1237,1239,1241,1243,1245,1247],{"class":226,"line":1238},62,[224,1240,207],{"class":230},[224,1242,400],{"class":234},[224,1244,287],{"class":234},[224,1246,329],{"class":234},[224,1248,407],{"class":234},[224,1250,1252],{"class":226,"line":1251},63,[224,1253,768],{"emptyLinePlaceholder":767},[224,1255,1257,1259,1261],{"class":226,"line":1256},64,[224,1258,443],{"class":230},[224,1260,446],{"class":234},[224,1262,449],{"class":234},[224,1264,1266,1268,1270,1272,1274],{"class":226,"line":1265},65,[224,1267,203],{"class":230},[224,1269,456],{"class":234},[224,1271,459],{"class":234},[224,1273,462],{"class":234},[224,1275,1276],{"class":494}," $NPM_PREFIX\n",[224,1278,1280,1282,1285,1288],{"class":226,"line":1279},66,[224,1281,1073],{"class":774},[224,1283,1284],{"class":234}," \"npm prefix set to ",[224,1286,1287],{"class":494},"$NPM_PREFIX",[224,1289,964],{"class":234},[224,1291,1293],{"class":226,"line":1292},67,[224,1294,768],{"emptyLinePlaceholder":767},[224,1296,1298,1300],{"class":226,"line":1297},68,[224,1299,1073],{"class":774},[224,1301,1302],{"class":234}," \"Node.js installation completed.\"\n",[224,1304,1306,1308],{"class":226,"line":1305},69,[224,1307,1073],{"class":774},[224,1309,1310],{"class":234}," \"Node version: \"\n",[224,1312,1314,1316],{"class":226,"line":1313},70,[224,1315,412],{"class":230},[224,1317,415],{"class":234},[224,1319,1321],{"class":226,"line":1320},71,[224,1322,768],{"emptyLinePlaceholder":767},[224,1324,1326,1328],{"class":226,"line":1325},72,[224,1327,1073],{"class":774},[224,1329,1084],{"class":234},[224,1331,1333],{"class":226,"line":1332},73,[224,1334,768],{"emptyLinePlaceholder":767},[224,1336,1338,1340,1342,1345,1347],{"class":226,"line":1337},74,[224,1339,1095],{"class":490},[224,1341,1101],{"class":230},[224,1343,1344],{"class":234}," \"Install pnpm?\"",[224,1346,1113],{"class":798},[224,1348,1116],{"class":490},[224,1350,1352,1354],{"class":226,"line":1351},75,[224,1353,1122],{"class":774},[224,1355,1356],{"class":234}," \"Installing pnpm...\"\n",[224,1358,1360,1363,1365,1367,1369,1371],{"class":226,"line":1359},76,[224,1361,1362],{"class":230},"    curl",[224,1364,235],{"class":234},[224,1366,527],{"class":234},[224,1368,242],{"class":241},[224,1370,532],{"class":230},[224,1372,369],{"class":234},[224,1374,1376,1378],{"class":226,"line":1375},77,[224,1377,1122],{"class":774},[224,1379,1380],{"class":234}," \"pnpm installation completed. Open a new terminal (or source your shell config) to use it.\"\n",[224,1382,1384],{"class":226,"line":1383},78,[224,1385,1139],{"class":490},[224,1387,1389],{"class":226,"line":1388},79,[224,1390,768],{"emptyLinePlaceholder":767},[224,1392,1394,1396],{"class":226,"line":1393},80,[224,1395,1073],{"class":774},[224,1397,1084],{"class":234},[224,1399,1401],{"class":226,"line":1400},81,[224,1402,768],{"emptyLinePlaceholder":767},[224,1404,1406,1408,1410,1413,1415],{"class":226,"line":1405},82,[224,1407,1095],{"class":490},[224,1409,1101],{"class":230},[224,1411,1412],{"class":234}," \"Install Bun?\"",[224,1414,1113],{"class":798},[224,1416,1116],{"class":490},[224,1418,1420,1422],{"class":226,"line":1419},83,[224,1421,1122],{"class":774},[224,1423,1424],{"class":234}," \"Installing Bun...\"\n",[224,1426,1428,1431,1433,1435,1437],{"class":226,"line":1427},84,[224,1429,1430],{"class":230},"    sudo",[224,1432,274],{"class":234},[224,1434,287],{"class":234},[224,1436,329],{"class":234},[224,1438,584],{"class":234},[224,1440,1442,1444,1446,1448,1450],{"class":226,"line":1441},85,[224,1443,1362],{"class":230},[224,1445,235],{"class":234},[224,1447,593],{"class":234},[224,1449,242],{"class":241},[224,1451,245],{"class":230},[224,1453,1455,1458,1461,1463,1465,1468],{"class":226,"line":1454},86,[224,1456,1457],{"class":490},"    export",[224,1459,1460],{"class":494}," BUN_INSTALL",[224,1462,1001],{"class":241},[224,1464,843],{"class":234},[224,1466,1467],{"class":494},"$HOME",[224,1469,1470],{"class":234},"\u002F.bun\"\n",[224,1472,1474,1476,1478,1480,1482,1485,1488,1491],{"class":226,"line":1473},87,[224,1475,1457],{"class":490},[224,1477,495],{"class":494},[224,1479,1001],{"class":241},[224,1481,843],{"class":234},[224,1483,1484],{"class":494},"$BUN_INSTALL",[224,1486,1487],{"class":234},"\u002Fbin:",[224,1489,1490],{"class":494},"$PATH",[224,1492,964],{"class":234},[224,1494,1496,1498],{"class":226,"line":1495},88,[224,1497,1122],{"class":774},[224,1499,1500],{"class":234}," \"Bun version: \"\n",[224,1502,1504,1507],{"class":226,"line":1503},89,[224,1505,1506],{"class":230},"    bun",[224,1508,415],{"class":234},[224,1510,1512],{"class":226,"line":1511},90,[224,1513,1139],{"class":490},[224,1515,1517],{"class":226,"line":1516},91,[224,1518,768],{"emptyLinePlaceholder":767},[224,1520,1522,1524],{"class":226,"line":1521},92,[224,1523,1073],{"class":774},[224,1525,1084],{"class":234},[224,1527,1529,1531],{"class":226,"line":1528},93,[224,1530,1073],{"class":774},[224,1532,1533],{"class":234}," \"Installation process finished.\"\n",[224,1535,1537,1539],{"class":226,"line":1536},94,[224,1538,1073],{"class":774},[224,1540,1084],{"class":234},[224,1542,1544,1546],{"class":226,"line":1543},95,[224,1545,1073],{"class":774},[224,1547,1548],{"class":234}," \"Add the global npm bin directory to your PATH by adding this line to your .bashrc or .zshrc:\"\n",[224,1550,1552,1554],{"class":226,"line":1551},96,[224,1553,1073],{"class":774},[224,1555,1556],{"class":234}," 'export PATH=~\u002F.npm-global\u002Fbin:$PATH'\n",[224,1558,1560,1562],{"class":226,"line":1559},97,[224,1561,1073],{"class":774},[224,1563,1084],{"class":234},[224,1565,1567,1569],{"class":226,"line":1566},98,[224,1568,1073],{"class":774},[224,1570,1571],{"class":234}," \"Node.js now comes from apt, so keep it patched with:\"\n",[224,1573,1575,1577],{"class":226,"line":1574},99,[224,1576,1073],{"class":774},[224,1578,1579],{"class":234}," \"sudo apt update && sudo apt upgrade\"\n",[224,1581,1583,1585],{"class":226,"line":1582},100,[224,1584,1073],{"class":774},[224,1586,1084],{"class":234},[68,1588,1590],{"id":1589},"keep-everything-up-to-date","Keep everything up to date",[10,1592,1593],{},"Once it's installed, keeping it up to date takes just a couple of commands:",[215,1595,1597],{"className":217,"code":1596,"language":219,"meta":220,"style":220},"# Operating system and Node.js\nsudo apt update && sudo apt upgrade\n\n# Package managers\npnpm self-update\nbun upgrade\nnpm update -g\n",[25,1598,1599,1604,1623,1627,1632,1639,1646],{"__ignoreMap":220},[224,1600,1601],{"class":226,"line":227},[224,1602,1603],{"class":681},"# Operating system and Node.js\n",[224,1605,1606,1608,1610,1613,1616,1618,1620],{"class":226,"line":280},[224,1607,207],{"class":230},[224,1609,274],{"class":234},[224,1611,1612],{"class":234}," update",[224,1614,1615],{"class":798}," &&",[224,1617,360],{"class":230},[224,1619,274],{"class":234},[224,1621,1622],{"class":234}," upgrade\n",[224,1624,1625],{"class":226,"line":685},[224,1626,768],{"emptyLinePlaceholder":767},[224,1628,1629],{"class":226,"line":691},[224,1630,1631],{"class":681},"# Package managers\n",[224,1633,1634,1636],{"class":226,"line":697},[224,1635,176],{"class":230},[224,1637,1638],{"class":234}," self-update\n",[224,1640,1641,1644],{"class":226,"line":702},[224,1642,1643],{"class":230},"bun",[224,1645,1622],{"class":234},[224,1647,1648,1650,1652],{"class":226,"line":708},[224,1649,203],{"class":230},[224,1651,1612],{"class":234},[224,1653,1654],{"class":234}," -g\n",[10,1656,1657,1658,1661,1662,1665],{},"And don't forget your project dependencies: ",[25,1659,1660],{},"pnpm outdated"," and ",[25,1663,1664],{},"pnpm audit"," tell you what needs updating.",[10,1667,1668,1669,1674,1675,1679],{},"That's also why I still don't use ",[14,1670,1673],{"href":1671,"rel":1672},"https:\u002F\u002Fgithub.com\u002Fnvm-sh\u002Fnvm",[18],"NVM"," day to day, as I explained in the ",[14,1676,1678],{"href":1677},"\u002Fblog\u002Finstall-node-24-on-ubuntu-24#what-about-nvm","previous post",". It's great if you really need several Node.js versions side by side, but every version you install with NVM is one more you have to remember to patch.",[10,1681,1682],{},"With AI speeding up how fast vulnerabilities are found and exploited, and security breaches that keep popping up, staying up to date has to be as easy as possible. Because now, more than ever, it's not optional.",[1684,1685,1686],"style",{},"html pre.shiki code .sMmZK, html code.shiki .sMmZK{--shiki-default:#1E66F5;--shiki-default-font-style:italic;--shiki-dark:#89B4FA;--shiki-dark-font-style:italic}html pre.shiki code .sgueU, html code.shiki .sgueU{--shiki-default:#40A02B;--shiki-dark:#A6E3A1}html pre.shiki code .sjJjI, html code.shiki .sjJjI{--shiki-default:#179299;--shiki-dark:#94E2D5}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sAS4m, html code.shiki .sAS4m{--shiki-default:#8839EF;--shiki-dark:#CBA6F7}html pre.shiki code .s0aCy, html code.shiki .s0aCy{--shiki-default:#4C4F69;--shiki-dark:#CDD6F4}html pre.shiki code .skWWU, html code.shiki .skWWU{--shiki-default:#EA76CB;--shiki-default-font-style:italic;--shiki-dark:#F5C2E7;--shiki-dark-font-style:italic}html pre.shiki code .som-u, html code.shiki .som-u{--shiki-default:#7C7F93;--shiki-default-font-style:italic;--shiki-dark:#9399B2;--shiki-dark-font-style:italic}html pre.shiki code .s-0VM, html code.shiki .s-0VM{--shiki-default:#D20F39;--shiki-default-font-style:italic;--shiki-dark:#F38BA8;--shiki-dark-font-style:italic}html pre.shiki code .sxyLT, html code.shiki .sxyLT{--shiki-default:#7C7F93;--shiki-dark:#9399B2}html pre.shiki code .s2f33, html code.shiki .s2f33{--shiki-default:#E64553;--shiki-default-font-style:italic;--shiki-dark:#EBA0AC;--shiki-dark-font-style:italic}html pre.shiki code .st0oN, html code.shiki .st0oN{--shiki-default:#FE640B;--shiki-dark:#FAB387}",{"title":220,"searchDepth":280,"depth":280,"links":1688},[1689,1690,1691,1692,1693,1694,1695],{"id":70,"depth":685,"text":71},{"id":145,"depth":685,"text":146},{"id":194,"depth":685,"text":195},{"id":293,"depth":685,"text":294},{"id":600,"depth":685,"text":601},{"id":643,"depth":685,"text":644},{"id":1589,"depth":685,"text":1590},"2026-11-05","On October 21, 2026, Node.js released security patches for ten vulnerabilities affecting its supported versions, four of them rated high, including a remote code execution issue. Unsupported versions, such as Node.js 20 and 25, won't be updated.","md",null,{},"\u002Fblog\u002Fapt-install-node-26-on-ubuntu-26",{"title":5,"description":1697},"blog\u002F0004.apt-install-node-26-on-ubuntu-26",[383,1705,27,1706,219,1707],"ubuntu","javascript","script",false,"HEU3aTb90rrOWuTuYEmniPSJeCS0y4ImXomd_a9N1_g",1793843388957]