Updating Node over Apt Causes Npm Downgrade

Every time I upgrade node.js (to 14.17.2 today) using apt, it somehow downgrades npm (e.g. from 7.19.1 to 6.14.13).
I have to manually upgrade npm using npm install -g npm every time. I've been doing this since npm version 7 came out and have experienced this issue on several machines (20.04, 18.04, Raspberry Pi OS x64, ...).

Node source file /etc/apt/sources.list.d/nodesource.list:

deb  focal main
deb-src  focal main

I've searched for similar issues on this network and on other sites, but found none.
Thanks for the help and information in advance!

1
Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article