KB / Memory / tech-debian-13-apt-node-20
Debian 13 apt ships Node 20
Debian 13 (trixie) nodejs is 20.x; Wrangler 4 and many CLIs need Node >=22. Install official 22 LTS to /usr/local and dpkg-divert /usr/bin/node.
Debian 13 apt nodejs is 20.x. Wrangler 4 refuses to start below 22.0.0. Do not replace the apt package — other Debian node-* packages depend on it.
To make Node 22 the system default:
- Extract the official
node-v22.*-linux-x64.tar.gzfrom nodejs.org into/usr/local(--strip-components=1)./usr/local/binis already first on the default PATH. dpkg-divert --local --divert /usr/bin/node.distrib --rename /usr/bin/nodethenln -sfn /usr/local/bin/node /usr/bin/node. Cron/systemdPATH=/usr/bin:/binand#!/usr/bin/nodethen get 22. Debian 20 stays at/usr/bin/node.distrib.- Prefer the
.tar.gzifxz-utilsis missing. VerifySHASUMS256.txt.
After this, node -v and /usr/bin/node -v are 22; npm/npx come from /usr/local/bin.