Failure of downloading package with the error "npm error code E500"

Our current Nexus version is 3.68.1, and we are having intermittent issue that package download is failed with the error, “npm error code E500”.

When we checked the memory at that time, we see no available memory as the result shown below.
[root@host.com]# free -g
total used free shared buff/cache available
Mem: 14 7 0 0 7 7
Swap: 9 0 9

Can you please help for the permanent solution? Will increasing memory resolve the issue permanently? Or is this a bug for 3.68.1 so we need to upgrade to newer version?

Thanks for your help in advance,
Chang