Presumably you have already stopped n8n using pm2 stop n8n before running npm install -g n8n@latest?
Are you by any chance doing anything else on your Raspi that might drive up CPU usage to unsustainable levels here? I am asking because I am running n8n with a very low CPU load (besides several other services consuming a lot more CPU power), though I am using a Pi 4 rather than a Pi Zero.
Another thing you might want to try would be to check whether your database might be the culprit here. If you are using a rather old version of n8n with SQLite, you might need to manually delete data as described in this thread (since a bug would have prevented automatic deletion of old executions from working as expected):
Hm, that’s odd. I suppose the machine might struggle with the npm install command seeing it has very limited resources, but unfortunately I don’t have it here so can’t test this first hand.
Would you be able to run npm in verbose mode (npm install -g n8n@latest -dd) to get an idea of what happens before it dies for you?