|
| 1 | +--- |
| 2 | +title: How to install Node.js on Ubuntu/Debian |
| 3 | +description: Install or update/downgrade Node.js to use it for Pterodactyl and Blueprint |
| 4 | +author: Emma |
| 5 | +category: community |
| 6 | +thumbnail: nodejs.jpeg |
| 7 | +--- |
| 8 | + |
| 9 | +## Introduction |
| 10 | + |
| 11 | +[Node.js](https://nodejs.org) is a JavaScript (ECMAScript) runtime. |
| 12 | +It allows you to run JavaScript code outside of your web browser. |
| 13 | +Node.js, and it's alternatives, are widely used across the web development space. |
| 14 | + |
| 15 | +Node.js itself, however, is usually not provided through your system's official software repositories. |
| 16 | +Even if it's provided, it's usually still more viable to use tools like [Fast Node Manager](https://github.com/Schniz/fnm) (fnm) as it allows you to quickly switch between Node.js versions. |
| 17 | + |
| 18 | +Node.js provides an [**official installation guide**](https://nodejs.org/en/download) on their website. |
| 19 | + |
| 20 | +## Install Node.js |
| 21 | + |
| 22 | +Blueprint requires Node version `v20.x` or later, though using the latest LTS release (which is `v24.x` at the time of writing this guide) is more viable long-term. |
| 23 | + |
| 24 | +We'll use [Fast Node Manager](https://github.com/Schniz/fnm) (fnm) to quickly install the `v24.x` version of Node.js. |
| 25 | + |
| 26 | +```bash |
| 27 | +# Download and install fnm |
| 28 | +curl -o- https://fnm.vercel.app/install | bash |
| 29 | + |
| 30 | +# Download and install Node.js v24.x using fnm |
| 31 | +fnm install 24 |
| 32 | + |
| 33 | +# Returns your node version |
| 34 | +node -v |
| 35 | +``` |
| 36 | + |
| 37 | +### Install the `yarn` package manager for Pterodactyl |
| 38 | + |
| 39 | +Blueprint and Pterodactyl require the `yarn` package manager to be used for managing node modules. You can install `yarn` like so: |
| 40 | + |
| 41 | +```bash |
| 42 | +# Install yarn |
| 43 | +npm i yarn -g |
| 44 | + |
| 45 | +# Returns your yarn version |
| 46 | +yarn -v |
| 47 | +``` |
| 48 | + |
| 49 | +Now you can use `yarn` to manage Pterodactyl's node modules. |
| 50 | + |
| 51 | +## Update and downgrade Node.js |
| 52 | + |
| 53 | +You can use [Fast Node Manager](https://github.com/Schniz/fnm) (fnm) to change the active version, like so: |
| 54 | + |
| 55 | +```bash |
| 56 | +# Use Node.js v24.x |
| 57 | +fnm use 24 |
| 58 | + |
| 59 | +# Use Node.js v22.x |
| 60 | +fnm use 22 |
| 61 | +``` |
| 62 | + |
| 63 | +Then you can check your Node.js version with the following command: |
| 64 | + |
| 65 | +```bash |
| 66 | +# Returns your node version |
| 67 | +node -v |
| 68 | +``` |
| 69 | + |
| 70 | +## Remove Node.js |
| 71 | + |
| 72 | +Finally, you can remove Node.js versions from your machine through [Fast Node Manager](https://github.com/Schniz/fnm) (fnm) with the following command: |
| 73 | + |
| 74 | +```bash |
| 75 | +# Uninstalls Node.js v24.x |
| 76 | +fnm uninstall 24 |
| 77 | +``` |
0 commit comments