Hi everyone,
I’m running DietPi on ARM64 raspberry pi 4b and I’ve run into a persistent issue with Node.js + npm.
Current setup
DietPi (latest)
ARM64 system
Node.js installed via NodeSource (v22.22.2)
npm is partially broken / inconsistent
Problem description
I originally tried to install npm via apt, which led to dependency conflicts between:
Debian npm package (node-* dependencies)
NodeSource nodejs
After cleanup attempts, the system now has:
Node.js:
node -v → working (NodeSource 22.22.2)
npm:
npm -v sometimes works (10.9.7)
but fails when upgrading:
MODULE_NOT_FOUND: promise-retry
Cannot find module inside /usr/lib/node_modules/npm
Observed state
which npm → /usr/bin/npm
/usr/lib/node_modules/npm exists but seems incomplete/broken
What I already tried
apt remove npm (confirmed not installed)
apt install --reinstall nodejs
dpkg --configure -a
apt --fix-broken install
manual removal of /usr/lib/node_modules/npm
reinstall NodeSource Node.js
Result
Node.js works, but npm remains unstable or missing dependencies after upgrade attempts.
Question
What is the correct and stable way on DietPi to:
fully clean Node.js + npm (NodeSource version)
avoid Debian npm conflicts
ensure npm works properly with Node 22
Is it recommended to:
use NodeSource only?
switch to nvm instead on DietPi?
or reinstall via DietPi optimized method?
Any guidance for a clean and stable setup would be appreciated.
Thanks! ![]()