Repository: nodesource/distributions Branch: master Commit: c6e581b0d24e Files: 35 Total size: 172.0 KB Directory structure: gitextract_2181wf0o/ ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ └── issue-bug-report.md │ └── workflows/ │ ├── ci.yaml │ └── deprecated.yaml ├── .gitignore ├── DEV_README.md ├── LICENSE.md ├── OLDER_DISTROS.md ├── OLD_README.md ├── README.md └── scripts/ ├── deb/ │ ├── script_generator/ │ │ ├── README.md │ │ ├── base_script.sh │ │ └── generator.sh │ ├── setup_16.x │ ├── setup_18.x │ ├── setup_20.x │ ├── setup_21.x │ ├── setup_22.x │ ├── setup_23.x │ ├── setup_24.x │ ├── setup_25.x │ ├── setup_current.x │ └── setup_lts.x └── rpm/ ├── script_generator/ │ ├── README.md │ ├── base_script.sh │ └── generator.sh ├── setup_16.x ├── setup_18.x ├── setup_20.x ├── setup_21.x ├── setup_22.x ├── setup_23.x ├── setup_24.x ├── setup_25.x ├── setup_current.x └── setup_lts.x ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/ISSUE_TEMPLATE/issue-bug-report.md ================================================ --- name: Issue/Bug report about: Create a report to help us improve. or resolve any issue title: "[ERROR] Node.js XX on UbuntuXX Installation fail" labels: bug assignees: '' --- **Describe your bug** A clear and concise description of what the bug is. **Distribution Information:** - OS: [e.g. Ubuntu] - Version [e.g. focal (20.04)] - Other info if applicable [e.g. Docker image XXX, AWS AMI ID] **Node Version:** - Node: [e.g. Node.js v18.x:] **To Reproduce** Steps to reproduce the behavior: 1. Execute Ubuntu Docker Image XX 2. Execute Installation instructions for Node.js v1x.x: 3. .... **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Additional context** Add any other context about the problem here, specify if already has another NodeJS version or if trying to re-install the current version. ================================================ FILE: .github/workflows/ci.yaml ================================================ name: "Test Installation Scripts" on: schedule: - cron: "00 00 * * *" push: branches: - master pull_request: branches: - master jobs: deb: name: "NodeJS ${{ matrix.version }}(${{ matrix.os }})" runs-on: ubuntu-latest strategy: matrix: version: [ 20, 22, 24, 25 ] os: [ "ubuntu:24.04", "ubuntu:22.04", "debian:13", "debian:11" ] container: image: ${{ matrix.os }} defaults: run: shell: bash steps: - name: Checkout Repo uses: actions/checkout@v4 - name: Run Installation Script run: ./scripts/deb/setup_${{ matrix.version }}.x - name: Audit Repository if: matrix.os == 'debian:13' run: apt update --audit - name: Install Nodejs run: apt install nodejs -y - name: Validate Node Version run: | node -e "console.log(process.version)" NODE_VERSION=$(node -e "console.log(process.version.split('.')[0])") if [[ ${NODE_VERSION} != "v${{ matrix.version }}" ]]; then echo "Node version is not ${{ matrix.version }}. It is $NODE_VERSION" exit 1 fi - name: Install NSolid if: matrix.version != 25 run: | apt remove nodejs -y apt install nsolid -y - name: Validate NSolid Version if: matrix.version != 25 run: | nsolid -e "console.log(process.version)" NSOLID_VERSION=$(nsolid -e "console.log(process.version.split('.')[0])") if [[ ${NSOLID_VERSION} != "v${{ matrix.version }}" ]]; then echo "NSolid version is not ${{ matrix.version }}. It is $NSOLID_VERSION" exit 1 fi rpm: name: "NodeJS ${{ matrix.version }}(${{ matrix.os }})" runs-on: ubuntu-latest strategy: matrix: version: [ 20, 22, 24, 25 ] os: [ "fedora:41", "amazonlinux:2023", "rockylinux:9", "rockylinux:8", "redhat/ubi9:latest" ] container: image: ${{ matrix.os }} defaults: run: shell: bash steps: - name: install git run: | dnf update -y dnf install git -y - name: Checkout Repo uses: actions/checkout@v4 - name: Run Istallation Script run: ./scripts/rpm/setup_${{ matrix.version }}.x - name: Audit Repository run: dnf repolist - name: Install Nodejs run: | dnf install nodejs -y - name: Validate Node Version run: | node -e "console.log(process.version)" NODE_VERSION=$(node -e "console.log((process.version).split('.')[0])") if [[ ${NODE_VERSION} != "v${{ matrix.version }}" ]]; then echo "Node version is not ${{ matrix.version }}. It is $NODE_VERSION" exit 1 fi - name: Install NSolid if: matrix.version != 25 run: | dnf remove nodejs -y dnf install nsolid -y - name: Validate NSolid Version if: matrix.version != 25 run: | nsolid -e "console.log(process.version)" NSOLID_VERSION=$(nsolid -e "console.log((process.version).split('.')[0])") if [[ ${NSOLID_VERSION} != "v${{ matrix.version }}" ]]; then echo "NSolid version is not ${{ matrix.version }}. It is $NSOLID_VERSION" exit 1 fi rpm-minimal: name: "NodeJS ${{ matrix.version }}(${{ matrix.os }})" runs-on: ubuntu-latest strategy: matrix: version: [ 20, 22, 24, 25] os: [ "rockylinux:9-minimal", "rockylinux:8-minimal", "redhat/ubi9-minimal:latest" ] container: image: ${{ matrix.os }} defaults: run: shell: bash steps: - name: install git run: | microdnf update -y microdnf install git -y - name: Checkout Repo uses: actions/checkout@v4 - name: Run Istallation Script run: ./scripts/rpm/setup_${{ matrix.version }}.x - name: Audit Repository run: microdnf repolist - name: Install Nodejs run: | microdnf install nodejs -y - name: Validate Node Version run: | node -e "console.log(process.version)" NODE_VERSION=$(node -e "console.log((process.version).split('.')[0])") if [[ ${NODE_VERSION} != "v${{ matrix.version }}" ]]; then echo "Node version is not ${{ matrix.version }}. It is $NODE_VERSION" exit 1 fi - name: Install NSolid if: matrix.version != 25 run: | microdnf remove nodejs -y microdnf install nsolid -y - name: Validate NSolid Version if: matrix.version != 25 run: | nsolid -e "console.log(process.version)" NSOLID_VERSION=$(nsolid -e "console.log((process.version).split('.')[0])") if [[ ${NSOLID_VERSION} != "v${{ matrix.version }}" ]]; then echo "NSolid version is not ${{ matrix.version }}. It is $NSOLID_VERSION" exit 1 fi ================================================ FILE: .github/workflows/deprecated.yaml ================================================ name: "Test Installation Scripts DEPRECATED VERSIONS" on: schedule: - cron: "00 00 * * *" # Run every day at midnight push: branches: - master pull_request: branches: - master jobs: deb: name: "NodeJS ${{ matrix.version }}(${{ matrix.os }})" runs-on: ubuntu-latest strategy: matrix: version: [ 16, 18 ] os: [ "ubuntu:20.04", "debian:10" ] container: image: ${{ matrix.os }} defaults: run: shell: bash steps: - name: Checkout Repo uses: actions/checkout@v4 - name: Fix sources.list for Debian 10 if: contains(matrix.os, 'debian:10') run: | echo "deb http://archive.debian.org/debian buster main" > /etc/apt/sources.list apt-get -o Acquire::Check-Valid-Until=false -o Acquire::AllowInsecureRepositories=true update - name: Run Installation Script run: ./scripts/deb/setup_${{ matrix.version }}.x - name: Install Nodejs run: | apt install nodejs -y - name: Validate Node Version run: | node -e "console.log(process.version)" NODE_VERSION=$(node -e "console.log(process.version.split('.')[0])") if [[ ${NODE_VERSION} != "v${{ matrix.version }}" ]]; then echo "Node version is not ${{ matrix.version }}. It is $NODE_VERSION" exit 1 fi rpm: name: "NodeJS ${{ matrix.version }}(${{ matrix.os }})" runs-on: ubuntu-latest strategy: matrix: version: [ 16, 18 ] os: [ "fedora:29", "amazonlinux:2023" ] container: image: ${{ matrix.os }} defaults: run: shell: bash steps: - name: install git run: | yum update -y yum install git -y - name: Checkout Repo uses: actions/checkout@v4 - name: Run Istallation Script run: ./scripts/rpm/setup_${{ matrix.version }}.x - name: Install Nodejs run: | yum install nodejs -y - name: Validate Node Version run: | node -e "console.log(process.version)" NODE_VERSION=$(node -e "console.log((process.version).split('.')[0])") if [[ ${NODE_VERSION} != "v${{ matrix.version }}" ]]; then echo "Node version is not ${{ matrix.version }}. It is $NODE_VERSION" exit 1 fi ================================================ FILE: .gitignore ================================================ .DS_Store .idea ================================================ FILE: DEV_README.md ================================================ # [NodeSource](https://nodesource.com) N|Solid & Node.js Binary Distributions [![NodeSource](images/ns-linux-distributions.svg)](https://nodesource.com) [![CircleCI](https://circleci.com/gh/nodesource/distributions/tree/master.svg?style=svg)](https://circleci.com/gh/nodesource/distributions/tree/master) [![Github Actions Test](https://github.com/nodesource/distributions/actions/workflows/ci.yaml/badge.svg)](https://github.com/nodesource/distributions/actions/workflows/ci.yaml) This repository contains the instructions to install the **[NodeSource N|solid](https://nodesource.com/products/runtime)** and **[Node.js](http://nodejs.org)** Binary Distributions via .rpm and .deb as well as their setup and support scripts. If you're looking for more information on NodeSource's low-impact Node.js performance monitoring platform, **[Learn more here](https://nodesource.com/products/nsolid).** ## **New Update ⚠️** We'd like to inform you of important changes to our distribution repository [nodesource/distributions](https://github.com/nodesource/distributions). **What's New:** - _**Package Changes:** DEB and RPM packages are now available under the `nodistro` codename. We no longer package the installer coupled to specific versions. This means you can install Node.js on almost any distro that meets the minimum requirements._ - **Installation Scripts:** Back by popular demand, the installation scripts have returned and are better than ever. See the installation instructions below for details on how to use them. - **RPM Package Signing Key:** The key used to sign RPM packages has changed. We now sign packages using SHA256, providing better support to the community. - **Questions and concerns:** To resolve questions and discuss concerns about this update we've opened this discussion space [New distribution's packages](https://github.com/nodesource/distributions/discussions/#123456) Looking for the previous Documentation [README.md](./OLD_README.md) ## Table of Contents - **[Debian and Ubuntu based distributions](#debian-and-ubuntu-based-distributions)** (deb) - [Available architectures](#deb-available-architectures) - [Supported Versions](#deb-supported-versions) - [Ubuntu versions](#ubuntu-versions) - [Debian versions](#debian-versions) - [Installation instructions](#installation-instructions) - [Uninstall instructions](#uninstall-nodejs-ubuntu--debian-packages) - **[Enterprise Linux based distributions](#enterprise-linux-based-distributions)** (rpm) - [Available architectures](#rpm-available-architectures) - [Supported Versions](#rpm-supported-versions) - [Fedora versions](#fedora-versions) - [Redhat versions](#redhat-versions) - [Amazon Linux versions](#amazon-linux-versions) - [Uninstall instructions](#uninstall-nodejs-enterprise-linux-packages) - **[Nodejs Release Calendar](#nodejs-release-calendar)** - [FAQ](#faq) - [Authors and Contributors](#authors-and-contributors) - [License](#license) ## Debian and Ubuntu based distributions ### DEB Available architectures NodeSource will continue to maintain the following architectures and may add additional ones in the future. - **amd64** (64-bit) - **armhf** (ARM 32-bit hard-float, ARMv7 and up: _arm-linux-gnueabihf_) - **arm64** (ARM 64-bit, ARMv8 and up: _aarch64-linux-gnu_) ### DEB Supported Versions #### **Ubuntu versions** | Distro Name | Node 18x | Node 20x | Node 21x | Node 22x | Node 23x | Node 24x | | :------------------- | :------: | :------: | :------: | :------: | :------: | :------: | | Ubuntu Bionic ^18.04 | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | | Ubuntu Focal ^20.04 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | Ubuntu Jammy ^22.04 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | Ubuntu Noble ^24.04 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | #### **Debian versions** | Distro Name | Node 18x | Node 20x | Node 21x | Node 22x | Node 23x | Node 24x | | :----------------- | :------: | :------: | :------: | :------: | :------: | :------: | | Debian 8 Jessie | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | | Debian 9 Stretch | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | | Debian 10 Buster | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | Debian 11 Bullseye | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | Debian 12 Bookworm | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | > [!NOTE] > If you are looking to run Node.js in a non-supported Linux version [contact NodeSource](https://nodesource.com/pages/contact-us.html) to get enterprise support for your specific needs. ### Installation Instructions (DEB) **Node.js 23.x**: ##### Using Ubuntu (Node.js 23) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh sudo apt install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh ``` 2. **Run the setup script with sudo:** ```sh sudo -E bash nodesource_setup.sh ``` 3. **Install Node.js:** ```sh sudo apt install -y nodejs ``` 4. **Verify the installation:** ```sh node -v ``` ##### Using Debian, as root (Node.js 23) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh apt install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh ``` 2. **Run the setup script with sudo:** ```sh bash nodesource_setup.sh ``` 3. **Install Node.js:** ```sh apt install -y nodejs ``` 4. **Verify the installation:** ```sh node -v ``` **Node.js v22.x**: ##### Using Ubuntu (Node.js 22) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh sudo apt install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh ``` 2. **Run the setup script with sudo:** ```sh sudo -E bash nodesource_setup.sh ``` 3. **Install N|Solid or Node.js:**
N|Solid **Install N|Solid:** ```sh sudo apt install -y nsolid ``` **Verify the installation:** ```sh nsolid -v ```
Node.js **Install Node.js:** ```sh sudo apt install -y nodejs ``` **Verify the installation:** ```sh node -v ```
##### Using Debian, as root (Node.js 22) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh apt install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh ``` 2. **Run the setup script with sudo:** ```sh bash nodesource_setup.sh ``` 3. **Install N|Solid or Node.js:**
N|Solid **Install N|Solid:** ```sh apt install -y nsolid ``` **Verify the installation:** ```sh nsolid -v ```
Node.js **Install Node.js:** ```sh apt install -y nodejs ``` **Verify the installation:** ```sh node -v ```
**Node.js v20.x**: ##### Using Ubuntu (Node.js 20) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh sudo apt install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh ``` 2. **Run the setup script with sudo:** ```sh sudo -E bash nodesource_setup.sh ``` 3. **Install N|Solid or Node.js:**
N|Solid **Install N|Solid:** ```sh sudo apt install -y nsolid ``` **Verify the installation:** ```sh nsolid -v ```
Node.js **Install Node.js:** ```sh sudo apt install -y nodejs ``` **Verify the installation:** ```sh node -v ```
##### Using Debian, as root (Node.js 20) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh apt install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh ``` 2. **Run the setup script with sudo:** ```sh bash nodesource_setup.sh ``` 3. **Install N|Solid or Node.js:**
N|Solid **Install N|Solid:** ```sh apt install -y nsolid ``` **Verify the installation:** ```sh nsolid -v ```
Node.js **Install Node.js:** ```sh apt install -y nodejs ``` **Verify the installation:** ```sh node -v ```
**Node.js v18.x**: ##### Using Ubuntu (Node.js 18) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh sudo apt install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://deb.nodesource.com/setup_18.x -o nodesource_setup.sh ``` 2. **Run the setup script with sudo:** ```sh sudo -E bash nodesource_setup.sh ``` 3. **Install N|Solid or Node.js:**
N|Solid **Install N|Solid:** ```sh sudo apt install -y nsolid ``` **Verify the installation:** ```sh nsolid -v ```
Node.js **Install Node.js:** ```sh sudo apt install -y nodejs ``` **Verify the installation:** ```sh node -v ```
##### Using Debian, as root (Node.js 18) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh apt install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://deb.nodesource.com/setup_18.x -o nodesource_setup.sh ``` 2. **Run the setup script with sudo:** ```sh bash nodesource_setup.sh ``` 3. **Install N|Solid or Node.js:**
N|Solid **Install N|Solid:** ```sh apt install -y nsolid ``` **Verify the installation:** ```sh nsolid -v ```
Node.js **Install Node.js:** ```sh apt install -y nodejs ``` **Verify the installation:** ```sh node -v ```
**Node.js LTS (v22.x)**: ##### Using Ubuntu (Node.js LTS) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh sudo apt install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://deb.nodesource.com/setup_lts.x -o nodesource_setup.sh ``` 2. **Run the setup script with sudo:** ```sh sudo -E bash nodesource_setup.sh ``` 3. **Install N|Solid or Node.js:**
N|Solid **Install N|Solid:** ```sh sudo apt install -y nsolid ``` **Verify the installation:** ```sh nsolid -v ```
Node.js **Install Node.js:** ```sh sudo apt install -y nodejs ``` **Verify the installation:** ```sh node -v ```
##### Using Debian, as root (N|Solid or Node.js LTS) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh apt install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://deb.nodesource.com/setup_lts.x -o nodesource_setup.sh ``` 2. **Run the setup script with sudo:** ```sh bash nodesource_setup.sh ``` 3. **Install N|Solid or Node.js:**
N|Solid **Install N|Solid:** ```sh apt install -y nsolid ``` **Verify the installation:** ```sh nsolid -v ```
Node.js **Install Node.js:** ```sh apt install -y nodejs ``` **Verify the installation:** ```sh node -v ```
**Node.js Current (24)**: ##### Using Ubuntu (Node.js Current) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh sudo apt install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://deb.nodesource.com/setup_current.x -o nodesource_setup.sh ``` 2. **Run the setup script with sudo:** ```sh sudo -E bash nodesource_setup.sh ``` 3. **Install Node.js:** ```sh sudo apt install -y nodejs ``` 4. **Verify the installation:** ```sh node -v ``` ##### Using Debian, as root (Node.js Current) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh apt install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://deb.nodesource.com/setup_current.x -o nodesource_setup.sh ``` 2. **Run the setup script with sudo:** ```sh bash nodesource_setup.sh ``` 3. **Install Node.js:** ```sh apt install -y nodejs ``` 4. **Verify the installation:** ```sh node -v ``` ### Uninstall `nsolid` or `nodejs` Ubuntu & Debian packages To completely remove Node.js or N|solid installed from the deb.nodesource.com package methods above: #### use `sudo` on Ubuntu or run this as root on debian
N|Solid ```sh apt purge nsolid &&\ rm -r /etc/apt/sources.list.d/nodesource.list &&\ rm -r /etc/apt/keyrings/nodesource.gpg ```
Node.js ```sh apt purge nodejs &&\ rm -r /etc/apt/sources.list.d/nodesource.list &&\ rm -r /etc/apt/keyrings/nodesource.gpg ```
## Enterprise Linux Based Distributions ### RPM Available architectures NodeSource will continue to maintain the following architectures and may add additional ones in the future. - **x86_64** (64-bit) - **arm64** (ARM 64-bit, ARMv8 and up: _aarch64-linux-gnu_) ### RPM Supported Versions #### **Fedora versions** | Distro Name | Node 18x | Node 20x | Node 21x | Node 22x | Node 23x | | :-------------------- | :------: | :------: | :------: | :------: | :------: | | Fedora >= 20 (20->28) | ❌ | ❌ | ❌ | ❌ | ❌ | | Fedora >= 29 | ✅ | ✅ | ✅ | ✅ | ✅ | | Fedora >= 36 | ✅ | ✅ | ✅ | ✅ | ✅ | #### **Redhat versions** | Distro Name | Node 18x | Node 20x | Node 21x | Node 22x | Node 23x | |:-----------------| :------: | :------: | :------: | :------: | :------: | | Redhat 7 | ❌ | ❌ | ❌ | ❌ | ❌ | | Redhat 8 | ✅ | ✅ | ✅ | ✅ | ✅ | | Redhat 9 | ✅ | ✅ | ✅ | ✅ | ✅ | | Redhat 9-minimal | ✅ | ✅ | ✅ | ✅ | ✅ | #### **Amazon Linux versions** | Distro Name | Node 18x | Node 20x | Node 21x | Node 22x | | :---------------- | :------: | :------: | :------: | :------: | | Amazon Linux 2 | ❌ | ❌ | ❌ | ❌ | | Amazon Linux 2023 | ✅ | ✅ | ✅ | ✅ | > [!NOTE] > If you are looking to run Node.js in a non-supported Linux version [contact NodeSource](https://nodesource.com/pages/contact-us.html) to get enterprise support for your specific needs. ### RPM Installation Instructions ### Installation Instructions (RPM) **Node.js v23.x** ##### Using RPM-based Systems (Node.js 23) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh sudo yum install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://rpm.nodesource.com/setup_23.x -o nodesource_setup.sh ``` 2. **Run the setup script as root:** ```sh sudo bash nodesource_setup.sh ``` 3. **Install Node.js:** ```sh sudo yum install -y nodejs ``` 4. **Verify the installation:** ```sh node -v ``` ##### No root privileges (Node.js 23) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh yum install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://rpm.nodesource.com/setup_23.x -o nodesource_setup.sh ``` 2. **Run the setup script as root:** ```sh bash nodesource_setup.sh ``` 3. **Install Node.js:** ```sh yum install -y nodejs ``` 4. **Verify the installation:** ```sh node -v ``` **Node.js v22.x** ##### Using RPM-based Systems (Node.js 22) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh sudo yum install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://rpm.nodesource.com/setup_22.x -o nodesource_setup.sh ``` 2. **Run the setup script as root:** ```sh sudo bash nodesource_setup.sh ``` 3. **Install Node.js:** ```sh sudo yum install -y nodejs ``` 4. **Verify the installation:** ```sh node -v ``` ##### No root privileges (Node.js 22) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh yum install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://rpm.nodesource.com/setup_22.x -o nodesource_setup.sh ``` 2. **Run the setup script as root:** ```sh bash nodesource_setup.sh ``` 3. **Install Node.js:** ```sh yum install -y nodejs ``` 4. **Verify the installation:** ```sh node -v ``` **Node.js v20.x** ##### As root (Node.js 20) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh sudo yum install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://rpm.nodesource.com/setup_20.x -o nodesource_setup.sh ``` 2. **Run the setup script as root:** ```sh bash nodesource_setup.sh ``` 3. **Install N|Solid or Node.js:**
N|Solid **Install N|Solid:** ```sh yum install -y nsolid ``` **Verify the installation:** ```sh nsolid -v ```
Node.js **Install Node.js:** ```sh yum install -y nodejs ``` **Verify the installation:** ```sh node -v ```
##### No root privileges (Node.js 20) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh yum install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://rpm.nodesource.com/setup_20.x -o nodesource_setup.sh ``` 2. **Run the setup script as root:** ```sh bash nodesource_setup.sh ``` 3. **Install N|Solid or Node.js:**
N|Solid **Install N|Solid:** ```sh sudo yum install -y nsolid ``` **Verify the installation:** ```sh nsolid -v ```
Node.js **Install Node.js:** ```sh sudo yum install -y nodejs ``` **Verify the installation:** ```sh node -v ```
**Node.js v18.x** ##### As root (Node.js 18) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh sudo yum install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://rpm.nodesource.com/setup_18.x -o nodesource_setup.sh ``` 2. **Run the setup script as root:** ```sh bash nodesource_setup.sh ``` 3. **Install N|Solid or Node.js:**
N|Solid **Install N|Solid:** ```sh sudo yum install -y nsolid ``` **Verify the installation:** ```sh nsolid -v ```
Node.js **Install Node.js:** ```sh sudo yum install -y nodejs ``` **Verify the installation:** ```sh node -v ```
##### No root privileges (Node.js 18) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh yum install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://rpm.nodesource.com/setup_18.x -o nodesource_setup.sh ``` 2. **Run the setup script as root:** ```sh sudo bash nodesource_setup.sh ``` 3. **Install N|Solid or Node.js:**
N|Solid **Install N|Solid:** ```sh sudo yum install -y nsolid ``` **Verify the installation:** ```sh nsolid -v ```
Node.js **Install Node.js:** ```sh sudo yum install -y nodejs ``` **Verify the installation:** ```sh node -v ```
**N|Solid or Node.js LTS (22.x)** ##### As root (N|Solid or Node.js LTS) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh yum install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://rpm.nodesource.com/setup_lts.x -o nodesource_setup.sh ``` 2. **Run the setup script as root:** ```sh bash nodesource_setup.sh ``` 3. **Install N|Solid or Node.js:**
N|Solid **Install N|Solid:** ```sh yum install -y nsolid ``` **Verify the installation:** ```sh nsolid -v ```
Node.js **Install Node.js:** ```sh yum install -y nodejs ``` **Verify the installation:** ```sh node -v ```
##### No root privileges (N|Solid or Node.js LTS) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh sudo yum install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://rpm.nodesource.com/setup_lts.x -o nodesource_setup.sh ``` 2. **Run the setup script as root:** ```sh sudo bash nodesource_setup.sh ``` 3. **Install N|Solid or Node.js:**
N|Solid **Install N|Solid:** ```sh sudo yum install -y nsolid ``` **Verify the installation:** ```sh nsolid -v ```
Node.js **Install Node.js:** ```sh sudo yum install -y nodejs ``` **Verify the installation:** ```sh node -v ```
**Node.js Current (24.x)** ##### As root (Node.js Current) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh yum install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://rpm.nodesource.com/setup_current.x -o nodesource_setup.sh ``` 2. **Run the setup script as root:** ```sh bash nodesource_setup.sh ``` 3. **Install Node.js:** ```sh yum install -y nodejs ``` 4. **Verify the installation:** ```sh node -v ``` ##### No root privileges (Node.js Current) Before you begin, ensure that `curl` is installed on your system. If `curl` is not installed, you can install it using the following command: ```sh sudo yum install -y curl ``` 1. **Download the setup script:** ```sh curl -fsSL https://rpm.nodesource.com/setup_current.x -o nodesource_setup.sh ``` 2. **Run the setup script as root:** ```sh sudo bash nodesource_setup.sh ``` 3. **Install Node.js:** ```sh sudo yum install -y nodejs ``` 4. **Verify the installation:** ```sh node -v ``` _**Optional**_: install build tools To compile and install native addons from npm you may also need to install build tools: ```text yum install gcc-c++ make # or: yum groupinstall 'Development Tools' ``` ### Uninstall `nsolid` or `nodejs` Enterprise Linux packages To completely remove Node.js installed from the rpm.nodesource.com package methods above: #### use `sudo` or run this as root
N|Solid ```sh yum remove nsolid &&\ rm -r /etc/yum.repos.d/nodesource*.repo &&\ yum clean all ```
Node.js ```sh yum remove nodejs &&\ rm -r /etc/yum.repos.d/nodesource*.repo &&\ yum clean all ```
## Nodejs Release Calendar [![Node Releases Calendar](https://raw.githubusercontent.com/nodejs/Release/main/schedule.svg?sanitize=true)](https://nodejs.dev/en/about/releases) _source: _ ## FAQ Q: Are the scripts deprecated? A: The scripts are deprecated for the versions of Node.js that are currently outdated. While the packages for these versions still exist, we no longer provide support for them. Our support is exclusively dedicated to the active Node.js versions, which, as of today, are 18, 20, and 21. Users utilizing these versions can confidently use our scripts, but we encourage those using older versions to upgrade for continued support and the best experience. --- Q: How can I configure the repository manually? A: If you prefer to manually configure the repository, we have a detailed guide to assist you through the process. Please visit our [Repository Manual Installation Guide](https://github.com/nodesource/distributions/wiki/Repository-Manual-Installation) for comprehensive instructions. This guide is designed to provide step-by-step directions to ensure a smooth and successful manual setup of the repository for your Node.js environment. --- Q: How do I pin to specific versions of Node.js? A: Please take a look at [wiki](https://github.com/nodesource/distributions/wiki/How-to-select-the-Node.js-version-to-install) --- --- Q: Why is there no folder listing available when I visit the following URLs? A: This issue may arise because some users utilize the above URLs to download specific versions of Node.js or create mirrors of our repository. For more information and possible solutions, please refer to the following resources: - [Github issue](https://github.com/nodesource/distributions/issues/1633) - [Creating a Repository Mirror](https://github.com/nodesource/distributions/wiki/Creating-a-Repository-Mirror:-A-Step%E2%80%90by%E2%80%90Step-Guide) --- ## Authors and Contributors ### Current Members
Adrian EstradaGitHub/edsadrTwitter/@edsadr
Jesus PazGitHub/JesusPaz
Jefferson RiosGitHub/riosje
### Past Members
Chris LeaGitHub/chrisleaTwitter/@chrislea
Rod VaggGitHub/rvaggTwitter/@rvagg
William BlankenshipGitHub/retrohackerTwitter/@retrohack3r
Harry TruongGitHub/harrytruong
Matteo BrunatiGitHub/mattbrun
Brian WhiteGitHub/mscdex
Matt LewandowskyGitHub/lewellyn
Jan-Hendrik PetersGitHub/hennr
Andris ReinmanGitHub/andris9
CarvilsiGitHub/carvilsi
Krasimir TrenchevGitHub/Ava7
Phil HelmGitHub/phelma
0xmohitGitHub/0xmohit
jdarlingGitHub/jdarling
Prayag VermaGitHub/pra85
Misha BrukmanGitHub/mbrukman
Simon LydellGitHub/lydell
Sebastian BleiGitHub/iamsebastian
Jorge Maldonado VenturaNotABug/jorgesumle
Mayank MethaGitHub/mayankmethaTwitter/@mayankmethad
Iván IguaránGitHub/igsu
Contributions are welcomed from anyone wanting to improve this project! ## License This material is Copyright (c) NodeSource and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included [LICENSE.md](./LICENSE.md) file for more details. --- _Supported with love by the [NodeSource](https://nodesource.com) team_ _This project is not affiliated with Debian, Ubuntu, Red Hat, CentOS or Fedora._ _Ubuntu is a registered trademark of Canonical Ltd._ _Debian is a registered trademark owned by Software in the Public Interest, Inc._ _Red Hat, CentOS and Fedora are trademarks of Red Hat, Inc._ _Amazon Linux is a trademark of Amazon Web Services, Inc._ _CloudLinux is a trademark of CloudLinux, Inc_ ================================================ FILE: LICENSE.md ================================================ The MIT License (MIT) ===================== Copyright (c) 2024 NodeSource LLC --------------------------------- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: OLDER_DISTROS.md ================================================ ## [Node.js](https://nodejs.org) on Older Linux Distributions At [NodeSource](https://nodesource.com), one of our primary missions is to encourage adoption of Node.js as much as possible. One of the ways we do this is by supplying binary packages of Node in formats compatible with the package management systems of various [Linux Distributions](https://github.com/nodesource/distributions/), so long as those distributions are still getting security updates from their respective sponsor entities. Unfortunately, this is more complicated in certain instances than in others. Due to the extremely long support cycles of some releases, such as LTS releases for Ubuntu, the components that the distributions ship with are not always sufficient to build or sometimes even to run very new and fast-moving software such as Node. ### Debian Style Distributions Two such examples that highlight this situation are the Debian Wheezy and Ubuntu Precise releases. Both are still currently receiving security updates. However, the default versions of the `C++` compilers that each ships with are not modern enough to build the current iterations of the V8 Javascript engine. In order to get around this issue, we build the packages <= v6.x for Debian Wheezy with [clang-3.4](http://clang.llvm.org/). Ubuntu Precise ships with [clang-3.4](http://clang.llvm.org) available, so we use that instead of GCC. The current expectation for v7.x of Node is that going forward, it will require use of even newer parts of the C++ standard than v6.x did. This will in turn require a compiler newer than both the `gcc` that ships on these distributions and `clang-3.4`. For this reason, we do not support Wheezy or Precise on version 7.x of Node. The relevant bits of our build scripts to install the needed compilers looks like this: ```bash #!/bin/bash if [ "x${DIST}" == "xprecise" ]; then echo "Calling $0" apt update apt install -y clang-3.4 fi if [ "x${DIST}" == "xwheezy" ]; then echo "Calling $0" apt update apt -y install curl apt-transport-https ca-certificates echo "deb https://deb.nodesource.com/clang-3.4 wheezy main" >> /etc/apt/sources.list curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - apt update apt install -y clang-3.4 fi ``` To actually use these compilers during the build, the scripts look like this: ```bash if [ "x${DIST}" == "xprecise" ]; then CC=/usr/bin/clang export CC CXX=/usr/bin/clang++ export CXX fi if [ "x${DIST}" == "xwheezy" ]; then CC=/usr/bin/clang export CC CXX=/usr/bin/clang++ export CXX fi ``` Please note that `arm` builds are not available for these two distributions, as we don't have compilers available for that target. ### RedHat Style Distributions Another example of this circumstance is RHEL6 / CentOS6 which use `rpm` packages. Much like in the Debian Style examples above, EL6 does not ship with a `C++` compiler that can build a modern version of V8. Additionally, the version of `python` in the distribution is not new enough to properly execute the `configure` script for the build. Fortunately, RedHat supports [SoftwareCollections.org](https://www.softwarecollections.org) and these collections can provide EL6 with newer versions of `GCC` and `python`. - The [Devtoolset-3](https://www.softwarecollections.org/en/scls/rhscl/devtoolset-3/) collection provides `GCC` - The [Python27](https://www.softwarecollections.org/en/scls/rhscl/python27/) collection provides `python` If you are running EL6 with our `rpm` packages for Node, and you intend to build any native add-on modules, you need to install and enable both of these collections by following the instructions at the links above. Also please note that for EL6, only the `x86_64` architecture is supported, as the aforementioned software collections do not have 32bit support. ================================================ FILE: OLD_README.md ================================================ # [NodeSource](https://nodesource.com) Node.js Binary Distributions [![NodeSource](images/ns-linux-distributions.svg)](https://nodesource.com) [![CircleCI](https://circleci.com/gh/nodesource/distributions/tree/master.svg?style=svg)](https://circleci.com/gh/nodesource/distributions/tree/master) This repository contains documentation for using the **[NodeSource](https://nodesource.com)** **[Node.js](http://nodejs.org)** Binary Distributions via .rpm and .deb as well as their setup and support scripts. If you are looking for NodeSource's low-impact Node.js performance monitoring platform, please **[get started here](https://accounts.nodesource.com/sign-up-linuxdistro).** Please file an issue if you are experiencing a problem or would like to discuss something related to the distributions. Pull requests are encouraged if you have changes you believe would improve the setup process or increase compatibility across Linux distributions. Looking for the oldversion of [README.md](./OLD_README.md) ## Table of Contents * **[Debian and Ubuntu based distributions](#deb)** (deb) * [Installation instructions](#debinstall) * [Uninstall instructions](#debuninstall) * [Manual installation](#debmanual) * **[Enterprise Linux based distributions](#rpm)** (rpm) * [Installation instructions](#rpminstall) * [Uninstall instructions](#rpmuninstall) * **[Tests](#tests)** * **[FAQ](#questions)** * **[Requested Distributions](#requests)** * **[License](#project-license)** `` ## Debian and Ubuntu based distributions **Available architectures:** NodeSource will continue to maintain the following architectures and may add additional ones in the future. * **amd64** (64-bit) * **armhf** (ARM 32-bit hard-float, ARMv7 and up: _arm-linux-gnueabihf_) * **arm64** (ARM 64-bit, ARMv8 and up: _aarch64-linux-gnu_) **Supported Ubuntu versions:** NodeSource will maintain Ubuntu distributions in active support by Canonical, including LTS and the intermediate releases. * ~~**Ubuntu 16.04 LTS** (Xenial Xerus)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**Ubuntu 18.04 LTS** (Bionic Beaver)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**Ubuntu 18.10** (Cosmic Cuttlefish)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**Ubuntu 19.04** (Disco Dingo)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**Ubuntu 19.10** (Eoan Ermine)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * **Ubuntu 20.04 LTS** (Focal Fossa) * **Ubuntu 20.10** (Groovy Gorilla) * **Ubuntu 21.04** (Hirsute Hippo) * **Ubuntu 21.10** (Impish Indri) * **Ubuntu 22.04** (Jammy Jellyfish) * **Ubuntu 22.10** (Kinetic Kudu) **Supported Debian versions:** NodeSource will maintain support for stable, testing and unstable releases of Debian, due to the long release cycle a considerable number of users are running unstable and testing. * ~~**Debian 9 / oldoldstable** (Stretch)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * **Debian 10 / oldstable** (Buster) * **Debian 11 / stable** (Bullseye) * **Debian unstable** (Sid) * **Debian testing** (Bookworm) **Supported Linux Mint versions:** * ~~**Linux Mint 18 "Sarah"** (via Ubuntu 16.04 LTS)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**Linux Mint 18.1 "Serena"** (via Ubuntu 16.04 LTS)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**Linux Mint 18.2 "Sonya"** (via Ubuntu 16.04 LTS)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**Linux Mint 18.3 "Sylvia"** (via Ubuntu 16.04 LTS)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**Linux Mint Debian Edition (LMDE) 2 "Betsy"** (via Debian 8)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**Linux Mint 19 "Tara"** (via Ubuntu 18.04 LTS)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**Linux Mint 19.1 "Tessa"** (via Ubuntu 18.04 LTS)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**Linux Mint 19.2 "Tina"** (via Ubuntu 18.04 LTS)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**Linux Mint 19.3 "Tricia"** (via Ubuntu 18.04 LTS)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * **Linux Mint 20 "Ulyana"** (via Ubuntu 20.04 LTS) * **Linux Mint 20.1 "Ulyssa"** (via Ubuntu 20.04 LTS) * **Linux Mint 20.2 "Uma"** (via Ubuntu 20.04 LTS) * **Linux Mint 20.3 "Una"** (via Ubuntu 20.04 LTS) * **Linux Mint 21 "Vanessa"** (via Ubuntu 22.04 LTS) * **Linux Mint 21.1 "Vera"** (via Ubuntu 22.04 LTS) * ~~**Linux Mint Debian Edition (LMDE) 3 "Cindy"** (via Debian 9)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * **Linux Mint Debian Edition (LMDE) 4 "Debbie"** (via Debian 10) * **Linux Mint Debian Edition (LMDE) 5 "Elsie"** (via Debian 11) **Supported Devuan versions:** * ~~**Ascii / oldoldstable** (via Debian 9)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * **Beowulf / oldstable** (via Debian 10) * **Chimaera / stable** (via Debian 11) * **Ceres / unstable** (via Debian unstable) **Supported elementary OS versions:** * ~~**elementary OS 0.4 Loki** (via Ubuntu 16.04 LTS)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**elementary OS 5 Juno** (via Ubuntu 18.04 LTS)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**elementary OS 5.1 Hera** (via Ubuntu 18.04 LTS)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * **elementary OS 6 Odin** (via Ubuntu 20.04 LTS) * **elementary OS 6.1 Jolnir** (via Ubuntu 20.04 LTS) * **elementary OS 7 horus** (via Ubuntu 22.04 LTS) **Supported Trisquel versions:** * ~~**Trisquel 8 "Flidas"** (via Ubuntu 16.04 LTS)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**Trisquel 9 "Etiona"** (via Ubuntu 18.04 LTS)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* **Supported BOSS versions:** * ~~**BOSS 7.0 "Drishti"** (via Debian 9)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * **BOSS 8.0 "Unnati"** (via Debian 10) * **BOSS 9.0 "Urja"** (via Debian 11) **Supported BunsenLabs versions:** * ~~**Helium** (via Debian 9)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * **Lithium** (via Debian 10) **Supported MX Linux versions:** * ~~**MX-17 Horizon** (via Debian 9)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**MX-18 Continuum** (via Debian 9)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * **MX-19 Patito Feo** (via Debian 10) * **MX-21 Wildflower** (via Debian 11) **Supported Sparky Linux versions:** * ~~**Sparky 4.x "Tyche"** (via Debian 9)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * **Sparky 5.x "Nibiru"** (via Debian 10) * **Sparky 6.x "Po Tolo"** (via Debian 11) **Supported PureOS Linux versions:** * **PureOS 9.0 "Amber"** (via Debian 10) * **PureOS 10.0 "Byzantium"** (via Debian 11) **Supported Astra Linux CE versions:** * ~~**Astra Linux CE 2.12 "Orel"** (via Debian 9)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* **Supported Ubilinux versions:** * ~~**Ubilinux 4.0 "Dolcetto"** (via Debian 9)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* **Supported Parrot OS Linux versions:** * **Parrot OS 5.0 "Electro Ara"** (via Debian 11) **Supported Deepin Linux versions:** * **Deepin 20 "Apricot"** (via Debian 10) `` ### Installation instructions **Node.js v20.x**: ##### Using Ubuntu ```sh curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - &&\ sudo apt install -y nodejs ``` ##### Using Debian, as root ```sh curl -fsSL https://deb.nodesource.com/setup_20.x | bash - &&\ apt install -y nodejs ``` **Node.js v19.x**: ##### Using Ubuntu ```sh curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash - &&\ sudo apt install -y nodejs ``` ##### Using Debian, as root ```sh curl -fsSL https://deb.nodesource.com/setup_19.x | bash - &&\ apt install -y nodejs ``` **Node.js v18.x**: ##### Using Ubuntu ```sh curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\ sudo apt install -y nodejs ``` ##### Using Debian, as root ```sh curl -fsSL https://deb.nodesource.com/setup_18.x | bash - &&\ apt install -y nodejs ``` **Node.js v16.x**: ##### Using Ubuntu ```sh curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - &&\ sudo apt install -y nodejs ``` ##### Using Debian, as root ```sh curl -fsSL https://deb.nodesource.com/setup_16.x | bash - &&\ apt install -y nodejs ``` **Node.js LTS (v18.x)**: ##### Using Ubuntu ```sh curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - &&\ sudo apt install -y nodejs ``` ##### Using Debian, as root ```sh curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - &&\ apt install -y nodejs ``` **Node.js Current (v20.x)**: ##### Using Ubuntu ```sh curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash - &&\ sudo apt install -y nodejs ``` ##### Using Debian, as root ```sh curl -fsSL https://deb.nodesource.com/setup_current.x | bash - &&\ apt install -y nodejs ``` ***Optional***: install build tools To compile and install native addons from npm you may also need to install build tools: ##### use `sudo` on Ubuntu or run this as root on debian ```sh apt install -y build-essential ``` `` ### Uninstall `nodejs` Ubuntu & Debian packages To completely remove Node.js installed from the deb.nodesource.com package methods above: ##### use `sudo` on Ubuntu or run this as root on debian ```sh apt purge nodejs &&\ rm -r /etc/apt/sources.list.d/nodesource.list ``` `` ### Manual installation If you're not a fan of `curl | bash -`, or are using an unsupported distribution, you can try a manual installation. These instructions assume `sudo` is present, however some distributions do not include this command by default, particularly those focused on a minimal environment. In this case, you should install `sudo` or `su` to root to run the commands directly. **1. Remove the old PPA if it exists** This step is only required if you previously used Chris Lea's Node.js PPA. ```sh # add-apt-repository may not be present on some Ubuntu releases: # sudo apt install python-software-properties sudo add-apt-repository -y -r ppa:chris-lea/node.js &&\ sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-*.list &&\ sudo rm -f /etc/apt/sources.list.d/chris-lea-node_js-*.list.save ``` **2. Add the NodeSource package signing key** ```sh KEYRING=/usr/share/keyrings/nodesource.gpg curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | sudo tee "$KEYRING" >/dev/null # wget can also be used: # wget --quiet -O - https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | sudo tee "$KEYRING" >/dev/null gpg --no-default-keyring --keyring "$KEYRING" --list-keys chmod a+r /usr/share/keyrings/nodesource.gpg ``` The key ID is `9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280`. **3. Add the desired NodeSource repository** ```sh # Replace with the branch of Node.js or io.js you want to install: node_8.x, node_16.x, etc... VERSION=node_16.x # Replace with the keyring above, if different KEYRING=/usr/share/keyrings/nodesource.gpg # The below command will set this correctly, but if lsb_release isn't available, you can set it manually: # - For Debian distributions: jessie, sid, etc... # - For Ubuntu distributions: xenial, bionic, etc... # - For Debian or Ubuntu derived distributions your best option is to use the codename corresponding to the upstream release your distribution is based off. This is an advanced scenario and unsupported if your distribution is not listed as supported per earlier in this README. DISTRO="$(lsb_release -s -c)" echo "deb [signed-by=$KEYRING] https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list echo "deb-src [signed-by=$KEYRING] https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list ``` **4. Update package lists and install Node.js** ```sh sudo apt update sudo apt install nodejs ``` `` ## Enterprise Linux based distributions **Available architectures:** NodeSource will continue to maintain the following architectures and may add additional ones in the future. * **x86_64** (64-bit) * **arm64** (ARM 64-bit, ARMv8 and up: _aarch64-linux-gnu_) **Supported Red Hat® Enterprise Linux® versions:** * ~~**RHEL 7** (64-bit)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * **RHEL 8** (64-bit) **Supported CentOS versions:** * ~~**CentOS 7** (64-bit)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * **CentOS 8** (64-bit) * **CentOS 8 Stream** (64-bit) **Supported AlmaLinux OS versions:** * **AlmaLinux 8** (64-bit) **Supported Mageia Linux versions:** * ~~**Mageia 7** (64-bit)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * **Mageia 8** (64-bit) **Supported Rocky Linux OS versions:** * **Rocky 8** (64-bit) **Supported CloudLinux versions:** * **CloudLinux 6** (32-bit for Node <= 10.x and 64-bit) **Supported Fedora versions:** * **Fedora 33** (64-bit) * **Fedora 34** (64-bit) * **Fedora 35** (64-bit) * **Fedora 36** (64-bit) **Supported Amazon Linux versions:** * ~~**Amazon Linux** (64-bit)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**Amazon Linux 2** (64-bit)~~ *WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+* * ~~**Amazon Linux 2023** (64-bit) `` ### Installation instructions _NOTE: If you are using RHEL 6 or CentOS 6, you might want to read about [running Node.js on older distros](https://github.com/nodesource/distributions/blob/master/OLDER_DISTROS.md)._ The Nodesource RPM package signing key is available here: Run on RHEL, CentOS, CloudLinux, Amazon Linux or Fedora: **Node.js v20.x** ##### As root ```sh curl -fsSL https://rpm.nodesource.com/setup_20.x | bash - ``` ##### No root privileges ```sh curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash - ``` **Node.js v19.x** ##### As root ```sh curl -fsSL https://rpm.nodesource.com/setup_19.x | bash - ``` ##### No root privileges ```sh curl -fsSL https://rpm.nodesource.com/setup_19.x | sudo bash - ``` **Node.js v18.x** ##### As root ```sh curl -fsSL https://rpm.nodesource.com/setup_18.x | bash - ``` ##### No root privileges ```sh curl -fsSL https://rpm.nodesource.com/setup_18.x | sudo bash - ``` **Node.js v16.x** ##### As root ```sh curl -fsSL https://rpm.nodesource.com/setup_16.x | bash - ``` ##### No root privileges ```sh curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash - ``` **Node.js LTS (18.x)** ##### As root ```sh curl -fsSL https://rpm.nodesource.com/setup_lts.x | bash - ``` ##### No root privileges ```sh curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash - ``` **Node.js Current (20.x)** ##### As root ```sh curl -fsSL https://rpm.nodesource.com/setup_current.x | bash - ``` ##### No root privileges ```sh curl -fsSL https://rpm.nodesource.com/setup_current.x | sudo bash - ``` ***Optional***: install build tools To compile and install native addons from npm you may also need to install build tools: ```text yum install gcc-c++ make # or: yum groupinstall 'Development Tools' ``` `` ### Uninstall `nodejs` Enterprise Linux packages To completely remove Node.js installed from the rpm.nodesource.com package methods above: #### use `sudo` or run this as root ```sh yum remove nodejs &&\ rm -r /etc/yum.repos.d/nodesource*.repo &&\ yum clean all ``` `` ## Tests To test an installation is working (and that the setup scripts are working!) use: ```sh curl -fsSL https://deb.nodesource.com/test | bash - ``` `` # FAQ Q: How do I use this repo when behind a proxy? A: Please take a look at [issue #9](https://github.com/nodesource/distributions/issues/9) --- Q: How do I pin to specific versions of Node.js? A: Please take a look at [issue #33](https://github.com/nodesource/distributions/issues/33#issuecomment-169345680) --- Q: I upgraded to a new major version of Node.js using the scripts, but the old version is still being installed, what is going on? A: You probably need to clear out your package manager's cache. Take a look at [issue #191](https://github.com/nodesource/distributions/issues/191) --- Q: I'm trying to install Node.js on CentOS 5 / RHEL 5 and it is failing, why? A: Due to the limitations of the compiler toolchain on EL 5 and its end of general support, we no longer support. See [issue #190](https://github.com/nodesource/distributions/issues/190) --- Q: I'm seeing "Your distribution, identified as "_.i686" or "_.i386, is not currently supported, why? A: Node.js 4.x and newer require a 64bit os for rpms. See [issue #268](https://github.com/nodesource/distributions/issues/268) --- Q: Why have certain versions of platforms/releases stopped receiving updates to Node.js? A: Unfortunately, newer versions of V8 require a modern compiler toolchain. On some platforms, such as ARM wheezy, that toolchain is not available. See [issue #247](https://github.com/nodesource/distributions/issues/247) --- Q: Why is my Node.js version newer than the one of the script I’ve run? A: Your package manager is probably installing a newer Node.js version from a different source. See [issue #657](https://github.com/nodesource/distributions/issues/657) --- Q: What is the current status of IPv6 support? A: See [issue #170](https://github.com/nodesource/distributions/issues/170) --- Q: I cannot install Node.js on Debian Jessie or Ubuntu Trusty Tahr: GPG error, why? A: See [issue #1181](https://github.com/nodesource/distributions/issues/1181) `` # Requested Distributions We, unfortunately, do not have the resources necessary to support and test the plethora of Linux releases in the wild, so we rely on community members such as yourself to get support on your favorite distributions! This is a list of releases that have been requested by the community. If you are interested in contributing to this project, this would be a great place to start! * OpenSUSE - [Issue #199](https://github.com/nodesource/distributions/issues/199) * Scientific Linux - [Issue #251](https://github.com/nodesource/distributions/issues/251) * TANGLU Bartholomea - [Issue #81](https://github.com/nodesource/distributions/issues/81) * Korora - [Issue #130](https://github.com/nodesource/distributions/issues/130) * FreePBX - [Issue #257](https://github.com/nodesource/distributions/issues/257) * PopOS - [Issue #924](https://github.com/nodesource/distributions/issues/924) * Kylin - [Issue #1011](https://github.com/nodesource/distributions/issues/1011) * MakuluLinux - [Issue #1012](https://github.com/nodesource/distributions/issues/1012) * GuixSD - [Issue #1297](https://github.com/nodesource/distributions/issues/1297) * XCP-ng - [Issue #1061](https://github.com/nodesource/distributions/issues/1061) * VzLinux - [Issue #1060](https://github.com/nodesource/distributions/issues/1060) `` ## Authors and Contributors
Chris LeaGitHub/chrisleaTwitter/@chrislea
Rod VaggGitHub/rvaggTwitter/@rvagg
William BlankenshipGitHub/retrohackerTwitter/@retrohack3r
Harry TruongGitHub/harrytruong
Matteo BrunatiGitHub/mattbrun
Brian WhiteGitHub/mscdex
Matt LewandowskyGitHub/lewellyn
Jan-Hendrik PetersGitHub/hennr
Andris ReinmanGitHub/andris9
CarvilsiGitHub/carvilsi
Krasimir TrenchevGitHub/Ava7
Phil HelmGitHub/phelma
0xmohitGitHub/0xmohit
jdarlingGitHub/jdarling
Prayag VermaGitHub/pra85
Misha BrukmanGitHub/mbrukman
Simon LydellGitHub/lydell
Sebastian BleiGitHub/iamsebastian
Jorge Maldonado VenturaNotABug/jorgesumle
Mayank MethaGitHub/mayankmethaTwitter/@mayankmethad
Adrian EstradaGitHub/edsadrTwitter/@edsadr
Iván IguaránGitHub/igsu
Jesus PazGitHub/JesusPaz
Contributions are welcomed from anyone wanting to improve this project! `` ## License This material is Copyright (c) NodeSource and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included [LICENSE.md](./LICENSE.md) file for more details. --- *Supported with love by the [NodeSource](https://nodesource.com) team* *This project is not affiliated with Debian, Ubuntu, Red Hat, CentOS or Fedora.*`
` *Ubuntu is a registered trademark of Canonical Ltd.*`
` *Debian is a registered trademark owned by Software in the Public Interest, Inc.*`
` *Red Hat, CentOS and Fedora are trademarks of Red Hat, Inc.*`
` *CloudLinux is a trademark of Cloud Linux, Inc* ================================================ FILE: README.md ================================================ [![NodeSource Distributions banner](https://github.com/user-attachments/assets/9c9a9712-2d70-4b96-b59f-a5aeca4b97e5)](https://nodesource.com/products/distributions) See the old documentation in the ➡️ [DEV_README.md](./DEV_README.md) ================================================ FILE: scripts/deb/script_generator/README.md ================================================ # Node.js Version Setup Scripts This repository contains scripts for setting up different versions of Node.js on Debian based Linux systems. ## Modifying the Scripts Each script in this repository sets up a specific version of Node.js. The version is specified in the line `NODE_VERSION="XX.x"` in each script. To modify the version, simply replace `"XX.x"` with the desired version, e.g., `"18.x"`. For example, to modify the `setup_18.x` script to install Node.js version 20.x instead, you would change the line to `NODE_VERSION="20.x"`. ## Running the Scripts To run a script, navigate to the directory containing the script and run the following command: ```bash sudo bash setup_XX.x ``` Replace `XX.x` with the version number of the script you want to run. For example, to run the `setup_18.x` script, you would use the command `sudo bash setup_18.x`. ## How It Works Each script in this repository performs the following steps: 1. Checks if the system is an Debian based Linux distribution. 2. Configures the NodeSource Node.js DEB repository for the specified version of Node.js. 3. Logs a message indicating that the repository is configured and updated, and instructs the user to run `apt install nodejs -y` to complete the installation. The `setup_current` and `setup_latest` scripts are special scripts that install the current and latest versions of Node.js, respectively. The current version is 20.x and the latest version is 21.x. ## Updating the Scripts If you make a change to the base script, you can regenerate all the version-specific scripts by running the generator script: ```bash bash generator.sh ``` This script iterates over a list of versions (currently 18.x, 20.x, and 21.x), and creates a new script for each version with the updated base script. It also creates setup_current and setup_latest scripts for the current and latest versions of Node.js, respectively. ## Deploying the Scripts After generating the scripts, you can deploy them to an S3 bucket using the AWS CLI. Here is the command to do so: ```bash aws s3 sync scripts/deb/ s3://deb.nodesource.com/ --exclude "*/**" ``` This command syncs all the files in the scripts/deb/ directory (but not its subdirectories) with the s3://deb.nodesource.com/ bucket. Make sure to replace s3://deb.nodesource.com/ with the path to your own S3 bucket. ================================================ FILE: scripts/deb/script_generator/base_script.sh ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } check_os() { if ! [ -f "/etc/debian_version" ]; then echo "Error: This script is only supported on Debian-based systems." exit 1 fi } # Function to Install the script pre-requisites install_pre_reqs() { log "Installing pre-requisites" "info" # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" fi # Run 'apt install' if ! apt install -y apt-transport-https ca-certificates curl gnupg; then handle_error "$?" "Failed to install packages" fi if ! mkdir -p /usr/share/keyrings; then handle_error "$?" "Makes sure the path /usr/share/keyrings exist or run ' mkdir -p /usr/share/keyrings' with sudo" fi rm -f /usr/share/keyrings/nodesource.gpg || true rm -f /etc/apt/sources.list.d/nodesource.list || true rm -f /etc/apt/sources.list.d/nodesource.sources || true # Run 'curl' and 'gpg' to download and import the NodeSource signing key if ! curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to download and import the NodeSource signing key" fi # Explicitly set the permissions to ensure the file is readable by all if ! chmod 644 /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to set correct permissions on /usr/share/keyrings/nodesource.gpg" fi } # Function to configure the Repo configure_repo() { local node_version=$1 arch=$(dpkg --print-architecture) if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ]; then handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64 are supported. Contact Nodesource for an extended support version https://nodesource.com/pages/contact-us.html." fi cat < /dev/null Types: deb URIs: https://deb.nodesource.com/node_$node_version Suites: nodistro Components: main Architectures: $arch Signed-By: /usr/share/keyrings/nodesource.gpg EOF # N|solid Config echo "Package: nsolid" | tee /etc/apt/preferences.d/nsolid > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nsolid > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nsolid > /dev/null # Nodejs Config echo "Package: nodejs" | tee /etc/apt/preferences.d/nodejs > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" else log "Repository configured successfully." log "To install Node.js, run: apt install nodejs -y" "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: apt install nsolid -y \n" "success" fi } # Define Node.js version NODE_VERSION="XX.x" # Check OS check_os # Main execution install_pre_reqs || handle_error $? "Failed installing pre-requisites" configure_repo "$NODE_VERSION" || handle_error $? "Failed configuring repository" ================================================ FILE: scripts/deb/script_generator/generator.sh ================================================ #!/bin/bash # Function to create a script for a given Node.js version create_script() { local version=$1 local script_name=$2 local target_script="../setup_$script_name.x" echo "Creating script for Node.js version $version.x" if sed "s/NODE_VERSION=\"XX.x\"/NODE_VERSION=\"$version.x\"/g" "$base_script" > "$target_script"; then echo "Script created successfully: $target_script" chmod +x "$target_script" echo "Execute permissions set for: $target_script" else echo "Error: Failed to create script for version $version.x" return 1 fi } # Check if the base script exists base_script="./base_script.sh" if [ ! -f "$base_script" ]; then echo "Error: Base script not found at $base_script" exit 1 fi # List of versions versions=("20" "22" "24" "25") # Iterate over the versions and create scripts for version in "${versions[@]}"; do create_script "$version" "$version" done # Define LTS and current Node.js versions lts_version="24" current_version="25" # Create setup_lts and setup_current scripts create_script "$lts_version" "lts" create_script "$current_version" "current" ================================================ FILE: scripts/deb/setup_16.x ================================================ #!/bin/bash if test -t 1; then # if terminal ncolors=$(which tput > /dev/null && tput colors) # supports color if test -n "$ncolors" && test $ncolors -ge 8; then termcols=$(tput cols) bold="$(tput bold)" underline="$(tput smul)" standout="$(tput smso)" normal="$(tput sgr0)" black="$(tput setaf 0)" red="$(tput setaf 1)" green="$(tput setaf 2)" yellow="$(tput setaf 3)" blue="$(tput setaf 4)" magenta="$(tput setaf 5)" cyan="$(tput setaf 6)" white="$(tput setaf 7)" fi fi print_bold() { title="$1" text="$2" echo echo "${red}================================================================================${normal}" echo "${red}================================================================================${normal}" echo echo -e " ${bold}${yellow}${title}${normal}" echo echo -en " ${text}" echo echo "${red}================================================================================${normal}" echo "${red}================================================================================${normal}" } # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Send deprecation Warning node_deprecation_warning() { print_bold \ " DEPRECATION WARNING " "\ ${bold}${underline} Node.js 16.x is no longer actively supported!${normal} ${bold}You will not receive security or critical stability updates${normal} for this version. You should migrate to a supported version of Node.js as soon as possible. Use the installation script that corresponds to the version of Node.js you wish to install. e.g. * ${red}https://deb.nodesource.com/setup_16.x — Node.js 16 \"Gallium\" ${bold}(deprecated)${normal} * ${green}https://deb.nodesource.com/setup_18.x — Node.js 18 \"Hydrogen\" (Maintenance)${normal} * ${red}https://deb.nodesource.com/setup_19.x — Node.js 19 \"Nineteen\" ${bold}(deprecated)${normal} * ${bold}${green}https://deb.nodesource.com/setup_20.x — Node.js 20 LTS \"Iron\" (recommended)${normal} * ${green}https://deb.nodesource.com/setup_21.x — Node.js 21 \"Iron\" (current)${normal} Please see ${bold}https://github.com/nodejs/Release${normal} for details about which version may be appropriate for you. The ${green}${bold}NodeSource${normal} Node.js distributions repository contains information both about supported versions of Node.js and supported Linux distributions. To learn more about usage, see the repository: ${underline}${bold}https://github.com/nodesource/distributions${normal} " echo echo "Continuing in 10 seconds ..." echo sleep 10 } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } check_os() { if ! [ -f "/etc/debian_version" ]; then echo "Error: This script is only supported on Debian-based systems." exit 1 fi } # Function to Install the script pre-requisites install_pre_reqs() { log "Installing pre-requisites" "info" # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" fi # Run 'apt install' if ! apt install -y apt-transport-https ca-certificates curl gnupg; then handle_error "$?" "Failed to install packages" fi if ! mkdir -p /usr/share/keyrings; then handle_error "$?" "Makes sure the path /usr/share/keyrings exist or run 'mkdir -p /usr/share/keyrings' with sudo" fi rm -f /usr/share/keyrings/nodesource.gpg || true rm -f /etc/apt/sources.list.d/nodesource.list || true # Run 'curl' and 'gpg' if ! curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to download and import the NodeSource signing key" fi } # Function to configure the Repo configure_repo() { local node_version=$1 arch=$(dpkg --print-architecture) if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ] && [ "$arch" != "armhf" ]; then handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64, and armhf are supported." fi echo "deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$node_version nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null # Nodejs Config echo "Package: nodejs" | tee /etc/apt/preferences.d/nodejs > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" else log "Repository configured successfully. To install Node.js, run: apt install nodejs -y" "success" fi } # Define Node.js version NODE_VERSION="16.x" # Check OS check_os # Main execution node_deprecation_warning install_pre_reqs || handle_error $? "Failed installing pre-requisites" configure_repo "$NODE_VERSION" || handle_error $? "Failed configuring repository" ================================================ FILE: scripts/deb/setup_18.x ================================================ #!/bin/bash # Send deprecation Warning node_deprecation_warning() { log " =============================================================================== DEPRECATION WARNING =============================================================================== Node.js 18.x is no longer actively supported! You will not receive security or critical stability updates for this version. You should migrate to a supported version of Node.js as soon as possible. Please see https://nodesource.com/products/distributions for details about which version may be appropriate for you. The NodeSource Node.js distributions site contains information both about supported versions of Node.js and N|Solid supported Linux distributions. To learn more about usage, see: https://nodesource.com/products/distributions =============================================================================== Continuing in 10 seconds ... " "error" sleep 10 } # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } check_os() { if ! [ -f "/etc/debian_version" ]; then echo "Error: This script is only supported on Debian-based systems." exit 1 fi } # Function to Install the script pre-requisites install_pre_reqs() { log "Installing pre-requisites" "info" # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" fi # Run 'apt install' if ! apt install -y apt-transport-https ca-certificates curl gnupg; then handle_error "$?" "Failed to install packages" fi if ! mkdir -p /usr/share/keyrings; then handle_error "$?" "Makes sure the path /usr/share/keyrings exist or run ' mkdir -p /usr/share/keyrings' with sudo" fi rm -f /usr/share/keyrings/nodesource.gpg || true rm -f /etc/apt/sources.list.d/nodesource.list || true # Run 'curl' and 'gpg' to download and import the NodeSource signing key if ! curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to download and import the NodeSource signing key" fi # Explicitly set the permissions to ensure the file is readable by all if ! chmod 644 /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to set correct permissions on /usr/share/keyrings/nodesource.gpg" fi } # Function to configure the Repo configure_repo() { local node_version=$1 arch=$(dpkg --print-architecture) if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ] && [ "$arch" != "armhf" ]; then handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64, and armhf are supported." fi echo "deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$node_version nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null # N|solid Config echo "Package: nsolid" | tee /etc/apt/preferences.d/nsolid > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nsolid > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nsolid > /dev/null # Nodejs Config echo "Package: nodejs" | tee /etc/apt/preferences.d/nodejs > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" else log "Repository configured successfully." log "To install Node.js, run: apt install nodejs -y" "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: apt install nsolid -y \n" "success" fi } # Define Node.js version NODE_VERSION="18.x" # Check OS check_os # Main execution node_deprecation_warning install_pre_reqs || handle_error $? "Failed installing pre-requisites" configure_repo "$NODE_VERSION" || handle_error $? "Failed configuring repository" ================================================ FILE: scripts/deb/setup_20.x ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } check_os() { if ! [ -f "/etc/debian_version" ]; then echo "Error: This script is only supported on Debian-based systems." exit 1 fi } # Function to Install the script pre-requisites install_pre_reqs() { log "Installing pre-requisites" "info" # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" fi # Run 'apt install' if ! apt install -y apt-transport-https ca-certificates curl gnupg; then handle_error "$?" "Failed to install packages" fi if ! mkdir -p /usr/share/keyrings; then handle_error "$?" "Makes sure the path /usr/share/keyrings exist or run ' mkdir -p /usr/share/keyrings' with sudo" fi rm -f /usr/share/keyrings/nodesource.gpg || true rm -f /etc/apt/sources.list.d/nodesource.list || true rm -f /etc/apt/sources.list.d/nodesource.sources || true # Run 'curl' and 'gpg' to download and import the NodeSource signing key if ! curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to download and import the NodeSource signing key" fi # Explicitly set the permissions to ensure the file is readable by all if ! chmod 644 /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to set correct permissions on /usr/share/keyrings/nodesource.gpg" fi } # Function to configure the Repo configure_repo() { local node_version=$1 arch=$(dpkg --print-architecture) if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ]; then handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64 are supported. Contact Nodesource for an extended support version https://nodesource.com/pages/contact-us.html." fi cat < /dev/null Types: deb URIs: https://deb.nodesource.com/node_$node_version Suites: nodistro Components: main Architectures: $arch Signed-By: /usr/share/keyrings/nodesource.gpg EOF # N|solid Config echo "Package: nsolid" | tee /etc/apt/preferences.d/nsolid > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nsolid > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nsolid > /dev/null # Nodejs Config echo "Package: nodejs" | tee /etc/apt/preferences.d/nodejs > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" else log "Repository configured successfully." log "To install Node.js, run: apt install nodejs -y" "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: apt install nsolid -y \n" "success" fi } # Define Node.js version NODE_VERSION="20.x" # Check OS check_os # Main execution install_pre_reqs || handle_error $? "Failed installing pre-requisites" configure_repo "$NODE_VERSION" || handle_error $? "Failed configuring repository" ================================================ FILE: scripts/deb/setup_21.x ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } check_os() { if ! [ -f "/etc/debian_version" ]; then echo "Error: This script is only supported on Debian-based systems." exit 1 fi } # Function to Install the script pre-requisites install_pre_reqs() { log "Installing pre-requisites" "info" # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" fi # Run 'apt install' if ! apt install -y apt-transport-https ca-certificates curl gnupg; then handle_error "$?" "Failed to install packages" fi if ! mkdir -p /usr/share/keyrings; then handle_error "$?" "Makes sure the path /usr/share/keyrings exist or run ' mkdir -p /usr/share/keyrings' with sudo" fi rm -f /usr/share/keyrings/nodesource.gpg || true rm -f /etc/apt/sources.list.d/nodesource.list || true # Run 'curl' and 'gpg' to download and import the NodeSource signing key if ! curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to download and import the NodeSource signing key" fi # Explicitly set the permissions to ensure the file is readable by all if ! chmod 644 /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to set correct permissions on /usr/share/keyrings/nodesource.gpg" fi } # Function to configure the Repo configure_repo() { local node_version=$1 arch=$(dpkg --print-architecture) if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ] && [ "$arch" != "armhf" ]; then handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64, and armhf are supported." fi echo "deb [arch=$arch signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$node_version nodistro main" | tee /etc/apt/sources.list.d/nodesource.list > /dev/null # N|solid Config echo "Package: nsolid" | tee /etc/apt/preferences.d/nsolid > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nsolid > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nsolid > /dev/null # Nodejs Config echo "Package: nodejs" | tee /etc/apt/preferences.d/nodejs > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" else log "Repository configured successfully." log "To install Node.js, run: apt install nodejs -y" "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: apt install nsolid -y \n" "success" fi } # Define Node.js version NODE_VERSION="21.x" # Check OS check_os # Main execution install_pre_reqs || handle_error $? "Failed installing pre-requisites" configure_repo "$NODE_VERSION" || handle_error $? "Failed configuring repository" ================================================ FILE: scripts/deb/setup_22.x ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } check_os() { if ! [ -f "/etc/debian_version" ]; then echo "Error: This script is only supported on Debian-based systems." exit 1 fi } # Function to Install the script pre-requisites install_pre_reqs() { log "Installing pre-requisites" "info" # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" fi # Run 'apt install' if ! apt install -y apt-transport-https ca-certificates curl gnupg; then handle_error "$?" "Failed to install packages" fi if ! mkdir -p /usr/share/keyrings; then handle_error "$?" "Makes sure the path /usr/share/keyrings exist or run ' mkdir -p /usr/share/keyrings' with sudo" fi rm -f /usr/share/keyrings/nodesource.gpg || true rm -f /etc/apt/sources.list.d/nodesource.list || true rm -f /etc/apt/sources.list.d/nodesource.sources || true # Run 'curl' and 'gpg' to download and import the NodeSource signing key if ! curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to download and import the NodeSource signing key" fi # Explicitly set the permissions to ensure the file is readable by all if ! chmod 644 /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to set correct permissions on /usr/share/keyrings/nodesource.gpg" fi } # Function to configure the Repo configure_repo() { local node_version=$1 arch=$(dpkg --print-architecture) if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ]; then handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64 are supported. Contact Nodesource for an extended support version https://nodesource.com/pages/contact-us.html." fi cat < /dev/null Types: deb URIs: https://deb.nodesource.com/node_$node_version Suites: nodistro Components: main Architectures: $arch Signed-By: /usr/share/keyrings/nodesource.gpg EOF # N|solid Config echo "Package: nsolid" | tee /etc/apt/preferences.d/nsolid > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nsolid > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nsolid > /dev/null # Nodejs Config echo "Package: nodejs" | tee /etc/apt/preferences.d/nodejs > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" else log "Repository configured successfully." log "To install Node.js, run: apt install nodejs -y" "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: apt install nsolid -y \n" "success" fi } # Define Node.js version NODE_VERSION="22.x" # Check OS check_os # Main execution install_pre_reqs || handle_error $? "Failed installing pre-requisites" configure_repo "$NODE_VERSION" || handle_error $? "Failed configuring repository" ================================================ FILE: scripts/deb/setup_23.x ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } check_os() { if ! [ -f "/etc/debian_version" ]; then echo "Error: This script is only supported on Debian-based systems." exit 1 fi } # Function to Install the script pre-requisites install_pre_reqs() { log "Installing pre-requisites" "info" # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" fi # Run 'apt install' if ! apt install -y apt-transport-https ca-certificates curl gnupg; then handle_error "$?" "Failed to install packages" fi if ! mkdir -p /usr/share/keyrings; then handle_error "$?" "Makes sure the path /usr/share/keyrings exist or run ' mkdir -p /usr/share/keyrings' with sudo" fi rm -f /usr/share/keyrings/nodesource.gpg || true rm -f /etc/apt/sources.list.d/nodesource.list || true rm -f /etc/apt/sources.list.d/nodesource.sources || true # Run 'curl' and 'gpg' to download and import the NodeSource signing key if ! curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to download and import the NodeSource signing key" fi # Explicitly set the permissions to ensure the file is readable by all if ! chmod 644 /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to set correct permissions on /usr/share/keyrings/nodesource.gpg" fi } # Function to configure the Repo configure_repo() { local node_version=$1 arch=$(dpkg --print-architecture) if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ]; then handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64 are supported. Contact Nodesource for an extended support version https://nodesource.com/pages/contact-us.html." fi cat < /dev/null Types: deb URIs: https://deb.nodesource.com/node_$node_version Suites: nodistro Components: main Architectures: $arch Signed-By: /usr/share/keyrings/nodesource.gpg EOF # N|solid Config echo "Package: nsolid" | tee /etc/apt/preferences.d/nsolid > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nsolid > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nsolid > /dev/null # Nodejs Config echo "Package: nodejs" | tee /etc/apt/preferences.d/nodejs > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" else log "Repository configured successfully." log "To install Node.js, run: apt install nodejs -y" "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: apt install nsolid -y \n" "success" fi } # Define Node.js version NODE_VERSION="23.x" # Check OS check_os # Main execution install_pre_reqs || handle_error $? "Failed installing pre-requisites" configure_repo "$NODE_VERSION" || handle_error $? "Failed configuring repository" ================================================ FILE: scripts/deb/setup_24.x ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } check_os() { if ! [ -f "/etc/debian_version" ]; then echo "Error: This script is only supported on Debian-based systems." exit 1 fi } # Function to Install the script pre-requisites install_pre_reqs() { log "Installing pre-requisites" "info" # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" fi # Run 'apt install' if ! apt install -y apt-transport-https ca-certificates curl gnupg; then handle_error "$?" "Failed to install packages" fi if ! mkdir -p /usr/share/keyrings; then handle_error "$?" "Makes sure the path /usr/share/keyrings exist or run ' mkdir -p /usr/share/keyrings' with sudo" fi rm -f /usr/share/keyrings/nodesource.gpg || true rm -f /etc/apt/sources.list.d/nodesource.list || true rm -f /etc/apt/sources.list.d/nodesource.sources || true # Run 'curl' and 'gpg' to download and import the NodeSource signing key if ! curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to download and import the NodeSource signing key" fi # Explicitly set the permissions to ensure the file is readable by all if ! chmod 644 /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to set correct permissions on /usr/share/keyrings/nodesource.gpg" fi } # Function to configure the Repo configure_repo() { local node_version=$1 arch=$(dpkg --print-architecture) if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ]; then handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64 are supported. Contact Nodesource for an extended support version https://nodesource.com/pages/contact-us.html." fi cat < /dev/null Types: deb URIs: https://deb.nodesource.com/node_$node_version Suites: nodistro Components: main Architectures: $arch Signed-By: /usr/share/keyrings/nodesource.gpg EOF # N|solid Config echo "Package: nsolid" | tee /etc/apt/preferences.d/nsolid > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nsolid > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nsolid > /dev/null # Nodejs Config echo "Package: nodejs" | tee /etc/apt/preferences.d/nodejs > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" else log "Repository configured successfully." log "To install Node.js, run: apt install nodejs -y" "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: apt install nsolid -y \n" "success" fi } # Define Node.js version NODE_VERSION="24.x" # Check OS check_os # Main execution install_pre_reqs || handle_error $? "Failed installing pre-requisites" configure_repo "$NODE_VERSION" || handle_error $? "Failed configuring repository" ================================================ FILE: scripts/deb/setup_25.x ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } check_os() { if ! [ -f "/etc/debian_version" ]; then echo "Error: This script is only supported on Debian-based systems." exit 1 fi } # Function to Install the script pre-requisites install_pre_reqs() { log "Installing pre-requisites" "info" # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" fi # Run 'apt install' if ! apt install -y apt-transport-https ca-certificates curl gnupg; then handle_error "$?" "Failed to install packages" fi if ! mkdir -p /usr/share/keyrings; then handle_error "$?" "Makes sure the path /usr/share/keyrings exist or run ' mkdir -p /usr/share/keyrings' with sudo" fi rm -f /usr/share/keyrings/nodesource.gpg || true rm -f /etc/apt/sources.list.d/nodesource.list || true rm -f /etc/apt/sources.list.d/nodesource.sources || true # Run 'curl' and 'gpg' to download and import the NodeSource signing key if ! curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to download and import the NodeSource signing key" fi # Explicitly set the permissions to ensure the file is readable by all if ! chmod 644 /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to set correct permissions on /usr/share/keyrings/nodesource.gpg" fi } # Function to configure the Repo configure_repo() { local node_version=$1 arch=$(dpkg --print-architecture) if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ]; then handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64 are supported. Contact Nodesource for an extended support version https://nodesource.com/pages/contact-us.html." fi cat < /dev/null Types: deb URIs: https://deb.nodesource.com/node_$node_version Suites: nodistro Components: main Architectures: $arch Signed-By: /usr/share/keyrings/nodesource.gpg EOF # N|solid Config echo "Package: nsolid" | tee /etc/apt/preferences.d/nsolid > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nsolid > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nsolid > /dev/null # Nodejs Config echo "Package: nodejs" | tee /etc/apt/preferences.d/nodejs > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" else log "Repository configured successfully." log "To install Node.js, run: apt install nodejs -y" "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: apt install nsolid -y \n" "success" fi } # Define Node.js version NODE_VERSION="25.x" # Check OS check_os # Main execution install_pre_reqs || handle_error $? "Failed installing pre-requisites" configure_repo "$NODE_VERSION" || handle_error $? "Failed configuring repository" ================================================ FILE: scripts/deb/setup_current.x ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } check_os() { if ! [ -f "/etc/debian_version" ]; then echo "Error: This script is only supported on Debian-based systems." exit 1 fi } # Function to Install the script pre-requisites install_pre_reqs() { log "Installing pre-requisites" "info" # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" fi # Run 'apt install' if ! apt install -y apt-transport-https ca-certificates curl gnupg; then handle_error "$?" "Failed to install packages" fi if ! mkdir -p /usr/share/keyrings; then handle_error "$?" "Makes sure the path /usr/share/keyrings exist or run ' mkdir -p /usr/share/keyrings' with sudo" fi rm -f /usr/share/keyrings/nodesource.gpg || true rm -f /etc/apt/sources.list.d/nodesource.list || true rm -f /etc/apt/sources.list.d/nodesource.sources || true # Run 'curl' and 'gpg' to download and import the NodeSource signing key if ! curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to download and import the NodeSource signing key" fi # Explicitly set the permissions to ensure the file is readable by all if ! chmod 644 /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to set correct permissions on /usr/share/keyrings/nodesource.gpg" fi } # Function to configure the Repo configure_repo() { local node_version=$1 arch=$(dpkg --print-architecture) if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ]; then handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64 are supported. Contact Nodesource for an extended support version https://nodesource.com/pages/contact-us.html." fi cat < /dev/null Types: deb URIs: https://deb.nodesource.com/node_$node_version Suites: nodistro Components: main Architectures: $arch Signed-By: /usr/share/keyrings/nodesource.gpg EOF # N|solid Config echo "Package: nsolid" | tee /etc/apt/preferences.d/nsolid > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nsolid > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nsolid > /dev/null # Nodejs Config echo "Package: nodejs" | tee /etc/apt/preferences.d/nodejs > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" else log "Repository configured successfully." log "To install Node.js, run: apt install nodejs -y" "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: apt install nsolid -y \n" "success" fi } # Define Node.js version NODE_VERSION="25.x" # Check OS check_os # Main execution install_pre_reqs || handle_error $? "Failed installing pre-requisites" configure_repo "$NODE_VERSION" || handle_error $? "Failed configuring repository" ================================================ FILE: scripts/deb/setup_lts.x ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } check_os() { if ! [ -f "/etc/debian_version" ]; then echo "Error: This script is only supported on Debian-based systems." exit 1 fi } # Function to Install the script pre-requisites install_pre_reqs() { log "Installing pre-requisites" "info" # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" fi # Run 'apt install' if ! apt install -y apt-transport-https ca-certificates curl gnupg; then handle_error "$?" "Failed to install packages" fi if ! mkdir -p /usr/share/keyrings; then handle_error "$?" "Makes sure the path /usr/share/keyrings exist or run ' mkdir -p /usr/share/keyrings' with sudo" fi rm -f /usr/share/keyrings/nodesource.gpg || true rm -f /etc/apt/sources.list.d/nodesource.list || true rm -f /etc/apt/sources.list.d/nodesource.sources || true # Run 'curl' and 'gpg' to download and import the NodeSource signing key if ! curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to download and import the NodeSource signing key" fi # Explicitly set the permissions to ensure the file is readable by all if ! chmod 644 /usr/share/keyrings/nodesource.gpg; then handle_error "$?" "Failed to set correct permissions on /usr/share/keyrings/nodesource.gpg" fi } # Function to configure the Repo configure_repo() { local node_version=$1 arch=$(dpkg --print-architecture) if [ "$arch" != "amd64" ] && [ "$arch" != "arm64" ]; then handle_error "1" "Unsupported architecture: $arch. Only amd64, arm64 are supported. Contact Nodesource for an extended support version https://nodesource.com/pages/contact-us.html." fi cat < /dev/null Types: deb URIs: https://deb.nodesource.com/node_$node_version Suites: nodistro Components: main Architectures: $arch Signed-By: /usr/share/keyrings/nodesource.gpg EOF # N|solid Config echo "Package: nsolid" | tee /etc/apt/preferences.d/nsolid > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nsolid > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nsolid > /dev/null # Nodejs Config echo "Package: nodejs" | tee /etc/apt/preferences.d/nodejs > /dev/null echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null # Run 'apt update' if ! apt update -y; then handle_error "$?" "Failed to run 'apt update'" else log "Repository configured successfully." log "To install Node.js, run: apt install nodejs -y" "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: apt install nsolid -y \n" "success" fi } # Define Node.js version NODE_VERSION="24.x" # Check OS check_os # Main execution install_pre_reqs || handle_error $? "Failed installing pre-requisites" configure_repo "$NODE_VERSION" || handle_error $? "Failed configuring repository" ================================================ FILE: scripts/rpm/script_generator/README.md ================================================ # Node.js Version Setup Scripts This repository contains scripts for setting up different versions of Node.js on RPM-based Linux systems. ## Modifying the Scripts Each script in this repository sets up a specific version of Node.js. The version is specified in the line `NODE_VERSION="XX.x"` in each script. To modify the version, simply replace `"XX.x"` with the desired version, e.g., `"18.x"`. For example, to modify the `setup_18.x` script to install Node.js version 20.x instead, you would change the line to `NODE_VERSION="20.x"`. ## Running the Scripts To run a script, navigate to the directory containing the script and run the following command: ```bash sudo bash setup_XX.x ``` Replace `XX.x` with the version number of the script you want to run. For example, to run the `setup_18.x` script, you would use the command `sudo bash setup_18.x`. ## How It Works Each script in this repository performs the following steps: 1. Checks if the system is an RPM-based Linux distribution. 2. Configures the NodeSource Node.js RPM repository for the specified version of Node.js. 3. Checks if `dnf`, `yum` or `microdnf` is available and updates the system using the available package manager. 4. Logs a message indicating that the repository is configured and updated, and instructs the user to run `dnf install nodejs -y`, `yum install nodejs -y` or `microdnf install nodejs -y` to complete the installation. The `setup_current` and `setup_latest` scripts are special scripts that install the current and latest versions of Node.js, respectively. The current version is 20.x and the latest version is 21.x. ## Updating the Scripts If you make a change to the base script, you can regenerate all the version-specific scripts by running the generator script: ```bash bash generator.sh ``` This script iterates over a list of versions (currently 18.x, 20.x, and 21.x), and creates a new script for each version with the updated base script. It also creates setup_current and setup_latest scripts for the current and latest versions of Node.js, respectively. ## Deploying the Scripts After generating the scripts, you can deploy them to an S3 bucket using the AWS CLI. Here is the command to do so: ```bash aws s3 sync scripts/rpm/ s3://rpm.nodesource.com/ --exclude "*/**" ``` This command syncs all the files in the scripts/rpm/ directory (but not its subdirectories) with the s3://rpm.nodesource.com/ bucket. Make sure to replace s3://rpm.nodesource.com/ with the path to your own S3 bucket. ================================================ FILE: scripts/rpm/script_generator/base_script.sh ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } # Check if we are on an RPM-based system if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system." fi log "Cleaning up old repositories..." "info" rm -f /etc/yum.repos.d/nodesource*.repo log "Old repositories removed" "info" # Define Node.js version NODE_VERSION="XX.x" # Get system architecture SYS_ARCH=$(uname -m) # Validate system architecture case "$SYS_ARCH" in aarch64|x86_64) log "Supported architecture: $SYS_ARCH" "info" ;; *) handle_error 1 "Unsupported architecture: $SYS_ARCH. Only aarch64 and x86_64 are supported." ;; esac # Repository content for Node.js NODEJS_REPO_CONTENT="[nodesource-nodejs] name=Node.js Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nodejs/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write Node.js repository content echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null # Check if Node.js version is an LTS version if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then # Repository content for N|Solid NSOLID_REPO_CONTENT="[nodesource-nsolid] name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nsolid/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write N|Solid repository content echo "$NSOLID_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nsolid.repo > /dev/null log "Added N|Solid repository for LTS version: $NODE_VERSION" "info" fi # Check for availability of dnf, yum or microdnf if command_exists dnf; then log "dnf available, updating..." "info" dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: dnf install nsolid -y" "success" else log "Repository is configured and updated." "info" fi log "Run 'dnf install nodejs -y' to complete the installation." "info" exit 0 elif command_exists yum; then log "yum available, updating..." "info" yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "Run 'yum install nsolid -y' to complete the installation." "success" else log "Repository is configured and updated." "info" fi log "Run 'yum install nodejs -y' to complete the installation." "info" elif command_exists microdnf; then log "microdnf available, updating..." "info" microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info" else log "Repository is configured and updated." "info" fi log "Run 'microdnf install nodejs -y' to complete the installation." "info" else handle_error 1 "Neither yum, dnf nor microdnf package manager was found. Please update your system using your package manager." fi ================================================ FILE: scripts/rpm/script_generator/generator.sh ================================================ #!/bin/bash # Function to create a script for a given Node.js version create_script() { local version=$1 local script_name=$2 local target_script="../setup_$script_name.x" echo "Creating script for Node.js version $version.x" if sed "s/NODE_VERSION=\"XX.x\"/NODE_VERSION=\"$version.x\"/g" "$base_script" > "$target_script"; then echo "Script created successfully: $target_script" chmod +x "$target_script" echo "Execute permissions set for: $target_script" else echo "Error: Failed to create script for version $version.x" return 1 fi } # Check if the base script exists base_script="./base_script.sh" if [ ! -f "$base_script" ]; then echo "Error: Base script not found at $base_script" exit 1 fi # List of versions versions=("23" "24" "25") # Iterate over the versions and create scripts for version in "${versions[@]}"; do create_script "$version" "$version" done # Define LTS and current Node.js versions lts_version="24" current_version="25" # Create setup_lts and setup_current scripts create_script "$lts_version" "lts" create_script "$current_version" "current" ================================================ FILE: scripts/rpm/setup_16.x ================================================ #!/bin/bash if test -t 1; then # if terminal ncolors=$(which tput > /dev/null && tput colors) # supports color if test -n "$ncolors" && test $ncolors -ge 8; then termcols=$(tput cols) bold="$(tput bold)" underline="$(tput smul)" standout="$(tput smso)" normal="$(tput sgr0)" black="$(tput setaf 0)" red="$(tput setaf 1)" green="$(tput setaf 2)" yellow="$(tput setaf 3)" blue="$(tput setaf 4)" magenta="$(tput setaf 5)" cyan="$(tput setaf 6)" white="$(tput setaf 7)" fi fi print_bold() { title="$1" text="$2" echo echo "${red}================================================================================${normal}" echo "${red}================================================================================${normal}" echo echo -e " ${bold}${yellow}${title}${normal}" echo echo -en " ${text}" echo echo "${red}================================================================================${normal}" echo "${red}================================================================================${normal}" } # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Send deprecation Warning node_deprecation_warning() { print_bold \ " DEPRECATION WARNING " "\ ${bold}${underline} Node.js 16.x is no longer actively supported!${normal} ${bold}You will not receive security or critical stability updates${normal} for this version. You should migrate to a supported version of Node.js as soon as possible. Use the installation script that corresponds to the version of Node.js you wish to install. e.g. * ${red}https://rpm.nodesource.com/setup_16.x — Node.js 16 \"Gallium\" ${bold}(deprecated)${normal} * ${green}https://rpm.nodesource.com/setup_18.x — Node.js 18 \"Hydrogen\" (Maintenance)${normal} * ${red}https://rpm.nodesource.com/setup_19.x — Node.js 19 \"Nineteen\" ${bold}(deprecated)${normal} * ${bold}${green}https://rpm.nodesource.com/setup_20.x — Node.js 20 LTS \"Iron\" (recommended)${normal} * ${green}https://rpm.nodesource.com/setup_21.x — Node.js 21 \"Iron\" (current)${normal} Please see ${bold}https://github.com/nodejs/Release${normal} for details about which version may be appropriate for you. The ${green}${bold}NodeSource${normal} Node.js distributions repository contains information both about supported versions of Node.js and supported Linux distributions. To learn more about usage, see the repository: ${underline}${bold}https://github.com/nodesource/distributions${normal} " echo echo "Continuing in 10 seconds ..." echo sleep 10 } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } # Check if we are on an RPM-based system if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system." fi node_deprecation_warning log "Cleaning up old repositories..." "info" rm -f /etc/yum.repos.d/nodesource*.repo log "Old repositories removed" "info" # Define Node.js version NODE_VERSION="16.x" # Get system architecture SYS_ARCH=$(uname -m) # Validate system architecture case "$SYS_ARCH" in aarch64|x86_64) log "Supported architecture: $SYS_ARCH" "info" ;; *) handle_error 1 "Unsupported architecture: $SYS_ARCH. Only aarch64 and x86_64 are supported." ;; esac # Repository content for Node.js NODEJS_REPO_CONTENT="[nodesource-nodejs] name=Node.js Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nodejs/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/NODESOURCE-GPG-SIGNING-KEY-EL module_hotfixes=1" # Write Node.js repository content echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null # Check for availability of dnf or yum if command_exists dnf; then log "dnf available, updating..." "info" dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" log "Repository is configured and updated. Run 'dnf install nodejs -y' to complete the installation." "info" exit 0 elif command_exists yum; then log "yum available, updating..." "info" yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs" log "Repository is configured and updated. Run 'yum install nodejs -y' to complete the installation." "info" else handle_error 1 "Neither yum nor dnf package manager was found. Please update your system using your package manager." fi ================================================ FILE: scripts/rpm/setup_18.x ================================================ #!/bin/bash # Send deprecation Warning node_deprecation_warning() { log " =============================================================================== DEPRECATION WARNING =============================================================================== Node.js 18.x is no longer actively supported! You will not receive security or critical stability updates for this version. You should migrate to a supported version of Node.js as soon as possible. Please see https://nodesource.com/products/distributions for details about which version may be appropriate for you. The NodeSource Node.js distributions site contains information both about supported versions of Node.js and N|Solid supported Linux distributions. To learn more about usage, see: https://nodesource.com/products/distributions =============================================================================== Continuing in 10 seconds ... " "error" sleep 10 } # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } # Check if we are on an RPM-based system if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system." fi # Send deprecation Warning node_deprecation_warning log "Cleaning up old repositories..." "info" rm -f /etc/yum.repos.d/nodesource*.repo log "Old repositories removed" "info" # Define Node.js version NODE_VERSION="18.x" # Get system architecture SYS_ARCH=$(uname -m) # Validate system architecture case "$SYS_ARCH" in aarch64|x86_64) log "Supported architecture: $SYS_ARCH" "info" ;; *) handle_error 1 "Unsupported architecture: $SYS_ARCH. Only aarch64 and x86_64 are supported." ;; esac # Repository content for Node.js NODEJS_REPO_CONTENT="[nodesource-nodejs] name=Node.js Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nodejs/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write Node.js repository content echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null # Check if Node.js version is an LTS version if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then # Repository content for N|Solid NSOLID_REPO_CONTENT="[nodesource-nsolid] name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nsolid/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write N|Solid repository content echo "$NSOLID_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nsolid.repo > /dev/null log "Added N|Solid repository for LTS version: $NODE_VERSION" "info" fi # Check for availability of dnf, yum or microdnf if command_exists dnf; then log "dnf available, updating..." "info" dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: dnf install nsolid -y" "success" else log "Repository is configured and updated." "info" fi log "Run 'dnf install nodejs -y' to complete the installation." "info" exit 0 elif command_exists yum; then log "yum available, updating..." "info" yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "Run 'yum install nsolid -y' to complete the installation." "success" else log "Repository is configured and updated." "info" fi log "Run 'yum install nodejs -y' to complete the installation." "info" elif command_exists microdnf; then log "microdnf available, updating..." "info" microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info" else log "Repository is configured and updated." "info" fi log "Run 'microdnf install nodejs -y' to complete the installation." "info" else handle_error 1 "Neither yum, dnf nor microdnf package manager was found. Please update your system using your package manager." fi ================================================ FILE: scripts/rpm/setup_20.x ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } # Check if we are on an RPM-based system if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system." fi log "Cleaning up old repositories..." "info" rm -f /etc/yum.repos.d/nodesource*.repo log "Old repositories removed" "info" # Define Node.js version NODE_VERSION="20.x" # Get system architecture SYS_ARCH=$(uname -m) # Validate system architecture case "$SYS_ARCH" in aarch64|x86_64) log "Supported architecture: $SYS_ARCH" "info" ;; *) handle_error 1 "Unsupported architecture: $SYS_ARCH. Only aarch64 and x86_64 are supported." ;; esac # Repository content for Node.js NODEJS_REPO_CONTENT="[nodesource-nodejs] name=Node.js Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nodejs/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write Node.js repository content echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null # Check if Node.js version is an LTS version if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then # Repository content for N|Solid NSOLID_REPO_CONTENT="[nodesource-nsolid] name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nsolid/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write N|Solid repository content echo "$NSOLID_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nsolid.repo > /dev/null log "Added N|Solid repository for LTS version: $NODE_VERSION" "info" fi # Check for availability of dnf, yum or microdnf if command_exists dnf; then log "dnf available, updating..." "info" dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: dnf install nsolid -y" "success" else log "Repository is configured and updated." "info" fi log "Run 'dnf install nodejs -y' to complete the installation." "info" exit 0 elif command_exists yum; then log "yum available, updating..." "info" yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "Run 'yum install nsolid -y' to complete the installation." "success" else log "Repository is configured and updated." "info" fi log "Run 'yum install nodejs -y' to complete the installation." "info" elif command_exists microdnf; then log "microdnf available, updating..." "info" microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info" else log "Repository is configured and updated." "info" fi log "Run 'microdnf install nodejs -y' to complete the installation." "info" else handle_error 1 "Neither yum, dnf nor microdnf package manager was found. Please update your system using your package manager." fi ================================================ FILE: scripts/rpm/setup_21.x ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } # Check if we are on an RPM-based system if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system." fi log "Cleaning up old repositories..." "info" rm -f /etc/yum.repos.d/nodesource*.repo log "Old repositories removed" "info" # Define Node.js version NODE_VERSION="21.x" # Get system architecture SYS_ARCH=$(uname -m) # Validate system architecture case "$SYS_ARCH" in aarch64|x86_64) log "Supported architecture: $SYS_ARCH" "info" ;; *) handle_error 1 "Unsupported architecture: $SYS_ARCH. Only aarch64 and x86_64 are supported." ;; esac # Repository content for Node.js NODEJS_REPO_CONTENT="[nodesource-nodejs] name=Node.js Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nodejs/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write Node.js repository content echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null # Repository content for N|Solid NSOLID_REPO_CONTENT="[nodesource-nsolid] name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nsolid/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Check if Node.js version is an LTS version if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]]; then # Write N|Solid repository content echo "$NSOLID_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nsolid.repo > /dev/null log "Added N|Solid repository for LTS version: $NODE_VERSION" "info" fi # Check for availability of dnf, yum or microdnf if command_exists dnf; then log "dnf available, updating..." "info" dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "Run 'dnf install nodejs -y' to complete the installation." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: dnf install nsolid -y\n" "success" exit 0 elif command_exists yum; then log "yum available, updating..." "info" yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "Run 'yum install nodejs -y' to complete the installation." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "Run 'yum install nsolid -y' to complete the installation." "success" elif command_exists microdnf; then log "microdnf available, updating..." "info" microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" --enablerepo="nodesource-nsolid" log "Repository is configured and updated. Run 'microdnf install nodejs -y' to complete the installation." "info" else handle_error 1 "Neither yum, dnf nor microdnf package manager was found. Please update your system using your package manager." fi ================================================ FILE: scripts/rpm/setup_22.x ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } # Check if we are on an RPM-based system if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system." fi log "Cleaning up old repositories..." "info" rm -f /etc/yum.repos.d/nodesource*.repo log "Old repositories removed" "info" # Define Node.js version NODE_VERSION="22.x" # Get system architecture SYS_ARCH=$(uname -m) # Validate system architecture case "$SYS_ARCH" in aarch64|x86_64) log "Supported architecture: $SYS_ARCH" "info" ;; *) handle_error 1 "Unsupported architecture: $SYS_ARCH. Only aarch64 and x86_64 are supported." ;; esac # Repository content for Node.js NODEJS_REPO_CONTENT="[nodesource-nodejs] name=Node.js Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nodejs/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write Node.js repository content echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null # Check if Node.js version is an LTS version if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then # Repository content for N|Solid NSOLID_REPO_CONTENT="[nodesource-nsolid] name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nsolid/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write N|Solid repository content echo "$NSOLID_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nsolid.repo > /dev/null log "Added N|Solid repository for LTS version: $NODE_VERSION" "info" fi # Check for availability of dnf, yum or microdnf if command_exists dnf; then log "dnf available, updating..." "info" dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: dnf install nsolid -y" "success" else log "Repository is configured and updated." "info" fi log "Run 'dnf install nodejs -y' to complete the installation." "info" exit 0 elif command_exists yum; then log "yum available, updating..." "info" yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "Run 'yum install nsolid -y' to complete the installation." "success" else log "Repository is configured and updated." "info" fi log "Run 'yum install nodejs -y' to complete the installation." "info" elif command_exists microdnf; then log "microdnf available, updating..." "info" microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "18.x" ]] || [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]]; then microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info" else log "Repository is configured and updated." "info" fi log "Run 'microdnf install nodejs -y' to complete the installation." "info" else handle_error 1 "Neither yum, dnf nor microdnf package manager was found. Please update your system using your package manager." fi ================================================ FILE: scripts/rpm/setup_23.x ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } # Check if we are on an RPM-based system if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system." fi log "Cleaning up old repositories..." "info" rm -f /etc/yum.repos.d/nodesource*.repo log "Old repositories removed" "info" # Define Node.js version NODE_VERSION="23.x" # Get system architecture SYS_ARCH=$(uname -m) # Validate system architecture case "$SYS_ARCH" in aarch64|x86_64) log "Supported architecture: $SYS_ARCH" "info" ;; *) handle_error 1 "Unsupported architecture: $SYS_ARCH. Only aarch64 and x86_64 are supported." ;; esac # Repository content for Node.js NODEJS_REPO_CONTENT="[nodesource-nodejs] name=Node.js Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nodejs/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write Node.js repository content echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null # Check if Node.js version is an LTS version if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then # Repository content for N|Solid NSOLID_REPO_CONTENT="[nodesource-nsolid] name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nsolid/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write N|Solid repository content echo "$NSOLID_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nsolid.repo > /dev/null log "Added N|Solid repository for LTS version: $NODE_VERSION" "info" fi # Check for availability of dnf, yum or microdnf if command_exists dnf; then log "dnf available, updating..." "info" dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: dnf install nsolid -y" "success" else log "Repository is configured and updated." "info" fi log "Run 'dnf install nodejs -y' to complete the installation." "info" exit 0 elif command_exists yum; then log "yum available, updating..." "info" yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "Run 'yum install nsolid -y' to complete the installation." "success" else log "Repository is configured and updated." "info" fi log "Run 'yum install nodejs -y' to complete the installation." "info" elif command_exists microdnf; then log "microdnf available, updating..." "info" microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info" else log "Repository is configured and updated." "info" fi log "Run 'microdnf install nodejs -y' to complete the installation." "info" else handle_error 1 "Neither yum, dnf nor microdnf package manager was found. Please update your system using your package manager." fi ================================================ FILE: scripts/rpm/setup_24.x ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } # Check if we are on an RPM-based system if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system." fi log "Cleaning up old repositories..." "info" rm -f /etc/yum.repos.d/nodesource*.repo log "Old repositories removed" "info" # Define Node.js version NODE_VERSION="24.x" # Get system architecture SYS_ARCH=$(uname -m) # Validate system architecture case "$SYS_ARCH" in aarch64|x86_64) log "Supported architecture: $SYS_ARCH" "info" ;; *) handle_error 1 "Unsupported architecture: $SYS_ARCH. Only aarch64 and x86_64 are supported." ;; esac # Repository content for Node.js NODEJS_REPO_CONTENT="[nodesource-nodejs] name=Node.js Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nodejs/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write Node.js repository content echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null # Check if Node.js version is an LTS version if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then # Repository content for N|Solid NSOLID_REPO_CONTENT="[nodesource-nsolid] name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nsolid/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write N|Solid repository content echo "$NSOLID_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nsolid.repo > /dev/null log "Added N|Solid repository for LTS version: $NODE_VERSION" "info" fi # Check for availability of dnf, yum or microdnf if command_exists dnf; then log "dnf available, updating..." "info" dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: dnf install nsolid -y" "success" else log "Repository is configured and updated." "info" fi log "Run 'dnf install nodejs -y' to complete the installation." "info" exit 0 elif command_exists yum; then log "yum available, updating..." "info" yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "Run 'yum install nsolid -y' to complete the installation." "success" else log "Repository is configured and updated." "info" fi log "Run 'yum install nodejs -y' to complete the installation." "info" elif command_exists microdnf; then log "microdnf available, updating..." "info" microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info" else log "Repository is configured and updated." "info" fi log "Run 'microdnf install nodejs -y' to complete the installation." "info" else handle_error 1 "Neither yum, dnf nor microdnf package manager was found. Please update your system using your package manager." fi ================================================ FILE: scripts/rpm/setup_25.x ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } # Check if we are on an RPM-based system if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system." fi log "Cleaning up old repositories..." "info" rm -f /etc/yum.repos.d/nodesource*.repo log "Old repositories removed" "info" # Define Node.js version NODE_VERSION="25.x" # Get system architecture SYS_ARCH=$(uname -m) # Validate system architecture case "$SYS_ARCH" in aarch64|x86_64) log "Supported architecture: $SYS_ARCH" "info" ;; *) handle_error 1 "Unsupported architecture: $SYS_ARCH. Only aarch64 and x86_64 are supported." ;; esac # Repository content for Node.js NODEJS_REPO_CONTENT="[nodesource-nodejs] name=Node.js Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nodejs/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write Node.js repository content echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null # Check if Node.js version is an LTS version if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then # Repository content for N|Solid NSOLID_REPO_CONTENT="[nodesource-nsolid] name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nsolid/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write N|Solid repository content echo "$NSOLID_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nsolid.repo > /dev/null log "Added N|Solid repository for LTS version: $NODE_VERSION" "info" fi # Check for availability of dnf, yum or microdnf if command_exists dnf; then log "dnf available, updating..." "info" dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: dnf install nsolid -y" "success" else log "Repository is configured and updated." "info" fi log "Run 'dnf install nodejs -y' to complete the installation." "info" exit 0 elif command_exists yum; then log "yum available, updating..." "info" yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "Run 'yum install nsolid -y' to complete the installation." "success" else log "Repository is configured and updated." "info" fi log "Run 'yum install nodejs -y' to complete the installation." "info" elif command_exists microdnf; then log "microdnf available, updating..." "info" microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info" else log "Repository is configured and updated." "info" fi log "Run 'microdnf install nodejs -y' to complete the installation." "info" else handle_error 1 "Neither yum, dnf nor microdnf package manager was found. Please update your system using your package manager." fi ================================================ FILE: scripts/rpm/setup_current.x ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } # Check if we are on an RPM-based system if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system." fi log "Cleaning up old repositories..." "info" rm -f /etc/yum.repos.d/nodesource*.repo log "Old repositories removed" "info" # Define Node.js version NODE_VERSION="25.x" # Get system architecture SYS_ARCH=$(uname -m) # Validate system architecture case "$SYS_ARCH" in aarch64|x86_64) log "Supported architecture: $SYS_ARCH" "info" ;; *) handle_error 1 "Unsupported architecture: $SYS_ARCH. Only aarch64 and x86_64 are supported." ;; esac # Repository content for Node.js NODEJS_REPO_CONTENT="[nodesource-nodejs] name=Node.js Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nodejs/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write Node.js repository content echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null # Check if Node.js version is an LTS version if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then # Repository content for N|Solid NSOLID_REPO_CONTENT="[nodesource-nsolid] name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nsolid/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write N|Solid repository content echo "$NSOLID_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nsolid.repo > /dev/null log "Added N|Solid repository for LTS version: $NODE_VERSION" "info" fi # Check for availability of dnf, yum or microdnf if command_exists dnf; then log "dnf available, updating..." "info" dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: dnf install nsolid -y" "success" else log "Repository is configured and updated." "info" fi log "Run 'dnf install nodejs -y' to complete the installation." "info" exit 0 elif command_exists yum; then log "yum available, updating..." "info" yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "Run 'yum install nsolid -y' to complete the installation." "success" else log "Repository is configured and updated." "info" fi log "Run 'yum install nodejs -y' to complete the installation." "info" elif command_exists microdnf; then log "microdnf available, updating..." "info" microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info" else log "Repository is configured and updated." "info" fi log "Run 'microdnf install nodejs -y' to complete the installation." "info" else handle_error 1 "Neither yum, dnf nor microdnf package manager was found. Please update your system using your package manager." fi ================================================ FILE: scripts/rpm/setup_lts.x ================================================ #!/bin/bash # Logger Function log() { local message="$1" local type="$2" local timestamp=$(date '+%Y-%m-%d %H:%M:%S') local color local endcolor="\033[0m" case "$type" in "info") color="\033[38;5;79m" ;; "success") color="\033[1;32m" ;; "error") color="\033[1;31m" ;; *) color="\033[1;34m" ;; esac echo -e "${color}${timestamp} - ${message}${endcolor}" } # Error handler function handle_error() { local exit_code=$1 local error_message="$2" log "Error: $error_message (Exit Code: $exit_code)" "error" exit $exit_code } # Function to check for command availability command_exists() { command -v "$1" &> /dev/null } # Check if we are on an RPM-based system if ! [ -f /etc/redhat-release ] && ! grep -q "Amazon Linux" /etc/system-release 2>/dev/null; then handle_error 1 "This script is intended for RPM-based systems. Please run it on an RPM-based system." fi log "Cleaning up old repositories..." "info" rm -f /etc/yum.repos.d/nodesource*.repo log "Old repositories removed" "info" # Define Node.js version NODE_VERSION="24.x" # Get system architecture SYS_ARCH=$(uname -m) # Validate system architecture case "$SYS_ARCH" in aarch64|x86_64) log "Supported architecture: $SYS_ARCH" "info" ;; *) handle_error 1 "Unsupported architecture: $SYS_ARCH. Only aarch64 and x86_64 are supported." ;; esac # Repository content for Node.js NODEJS_REPO_CONTENT="[nodesource-nodejs] name=Node.js Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nodejs/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write Node.js repository content echo "$NODEJS_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nodejs.repo > /dev/null # Check if Node.js version is an LTS version if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then # Repository content for N|Solid NSOLID_REPO_CONTENT="[nodesource-nsolid] name=N|Solid Packages for Linux RPM based distros - $SYS_ARCH baseurl=https://rpm.nodesource.com/pub_${NODE_VERSION}/nodistro/nsolid/$SYS_ARCH priority=9 enabled=1 gpgcheck=1 gpgkey=https://rpm.nodesource.com/gpgkey/ns-operations-public.key module_hotfixes=1" # Write N|Solid repository content echo "$NSOLID_REPO_CONTENT" | tee /etc/yum.repos.d/nodesource-nsolid.repo > /dev/null log "Added N|Solid repository for LTS version: $NODE_VERSION" "info" fi # Check for availability of dnf, yum or microdnf if command_exists dnf; then log "dnf available, updating..." "info" dnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then dnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "To install N|solid Runtime, run: dnf install nsolid -y" "success" else log "Repository is configured and updated." "info" fi log "Run 'dnf install nodejs -y' to complete the installation." "info" exit 0 elif command_exists yum; then log "yum available, updating..." "info" yum makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then yum makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated." "info" log "You can use N|solid Runtime as a node.js alternative" "info" log "Run 'yum install nsolid -y' to complete the installation." "success" else log "Repository is configured and updated." "info" fi log "Run 'yum install nodejs -y' to complete the installation." "info" elif command_exists microdnf; then log "microdnf available, updating..." "info" microdnf makecache --disablerepo="*" --enablerepo="nodesource-nodejs" # Update N|Solid repository if it's LTS if [[ "$NODE_VERSION" == "20.x" ]] || [[ "$NODE_VERSION" == "22.x" ]] || [[ "$NODE_VERSION" == "24.x" ]]; then microdnf makecache --disablerepo="*" --enablerepo="nodesource-nsolid" log "Repository is configured and updated. Run 'microdnf install nsolid -y' to complete the installation." "info" else log "Repository is configured and updated." "info" fi log "Run 'microdnf install nodejs -y' to complete the installation." "info" else handle_error 1 "Neither yum, dnf nor microdnf package manager was found. Please update your system using your package manager." fi