Out of memory error with Node.js and cPanel Terminal
Description
When running a npm or Node.js command via the Terminal app in cPanel, a “Out of memory” error message is returned.

Cause
The issue is not typically due to a hosting-level resource limit such as memory or storage.
The emulated Terminal app in cPanel itself has an artificial memory limit that prevents the command from running
Solution
Connect directly to SSH using your native SSH client (e.g. Terminal on macOS or Linux or PuTTY on Windows) to overcome the Terminal app’s memory limit.