> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.hodi.host/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How do I use Node.js over SSH or via the Terminal?

## What's the difference between "Setup Node.JS App" and the ".bashrc" method?

* "**Setup Node.JS App**": This tool is only for setting up a Node.JS application accessible over the web (such as an API or an Express.js site). It automatically sets up an environment and manages the web server's execution. [See the dedicated FAQ on this topic](https://help.hodi.host/en/article/how-do-i-deploy-a-nodejs-application-o2d8i4/).
* **The ".bashrc" method**: It gives you full control over Node.JS. You can run any Node.JS script, whether it's a [cron job](https://help.hodi.host/en/article/how-do-i-add-a-scheduled-task-cron-16qwojg/), a command-line tool, or a build script.

## How do I set up Node.JS with the ".bashrc" method?

1. **Log in via** [**SSH**](https://help.hodi.host/en/article/how-do-i-access-my-hosting-via-ssh-143pq07/) **to your server, or via the Terminal in** [**cPanel**](https://help.hodi.host/en/article/how-do-i-access-cpanel-en4rsm/)
2. **Check the available Node.JS versions:**
   `ls -ld /opt/alt/alt-nodejs*`
   If the version you want is missing, don't worry, our [technical support](https://hodi.host/submitticket.php?step=2&deptid=2) will install it for you :)  

3. **Run this command, adapting the path to the chosen version:**
   `echo 'export PATH=/opt/alt/alt-nodejs20/root/usr/bin/:$PATH' >> ~/.bashrc`

4. **Apply the new configuration:**
   `source ~/.bashrc`
   For your information, the configuration will be applied on your next logins, so you won't need to type this command again.

5. **Check that the Node.JS version you chose is now active:**
   `node -v`

6. **If you get a "RangeError: WebAssembly.instantiate(): Out of memory" error** on one of your scripts, run it via [SSH](https://help.hodi.host/en/article/how-do-i-access-my-hosting-via-ssh-143pq07/) rather than through the cPanel terminal (the latter imposes stricter limits on memory usage).