This is a bit of a weird issue and without more error logs or information I'm, at best, guessing at an answer, but I researched a bit because I thought this was pretty interesting.
"npm ERR! errno 3221225477" Error in Node when making a query using oracledb
There is a similar question that was previously asked, I don't know if that might be the complete error log for you as well, your node might just be suppressing it or something. The windows access violation there refers to a segment fault.
https://askubuntu.com/questions/641804/npm-v-return-segmentation-fault
There was also a similar question so it's not just related to windows. What's also interesting is that the person asking there installed on ubuntu using software center and not apt, so it might be something to do with npm not installing correctly since software center is usually bugged as hell.
https://github.com/breejs/bree/issues/103
It was also mentioned in quite a few git issues but all of them seem to be closed before anyone ever contributed more to it. Also interesting is that most of them started around 2020.
https://github.com/nodejs/help/issues/3145
There is another issue where someone said they got it because of unescaped bash script quotes.
Some people have mentioned that it's an issue related to your firewall, but I doubt that's the case if it's also happening on linux. Another person on the other hand said running it on linux it suddenly worked. It doesn't seem to me like it has anything to do with the platform.
Even more info is that a segment fault, https://en.wikipedia.org/wiki/Segmentation_fault, is caused when your software is trying to access either faulty or protected memory in which case the hardware will throw a segment fault error and shut down the process.
I also learned that if your code is using native packages built for a wrong version of node, it can also lead to a segment fault, in which case you'll either have to upgrade node or you'll have to rebuild those packages for the correct version.
I believe, just an utterly intuitive guess, that node isn't installing correctly or that something with the way it's installed is causing it to incorrectly access memory in a way it shouldn't. I think you should do a forced npm cache clean and also make sure that you've actually entirely uninstalled both npm and node, also purged all related files to both of them, then reinstall. Make sure you delete everything for node and npm, not just node, otherwise you might be trying to run the latest npm with a very old node which won't work. I also don't think you should be using NVM for such an older version of node, maybe it works, but I dunno, so if all else fails download the specific version you want from https://nodejs.org/en/download/releases/ or compile it from source yourself.
I thought this issue was pretty interesting so if you do end up finding a solid solution to it I'd like to know what exactly it was.