# Offline Node.js 22 setup for Ubuntu 20.04

This folder contains scripts to prepare and install fresh Node.js 22 without internet on target host.

## Files

- `prepare-online.sh` - run on internet-connected Linux machine
- `install-offline.sh` - run on offline Ubuntu 20.04 machine

## 1) On online machine

```bash
cd nodejs-offline-ubuntu2004
chmod +x prepare-online.sh install-offline.sh

# x64, latest v22
./prepare-online.sh x64

# OR arm64, latest v22
./prepare-online.sh arm64

# Optional: pin exact version
./prepare-online.sh x64 22.15.0
```

You will get directory like:
- `bundle-node-v22.15.0-linux-x64`

Copy this directory **and** `install-offline.sh` to offline machine.

## 2) On offline Ubuntu 20.04

```bash
chmod +x install-offline.sh
sudo ./install-offline.sh ./bundle-node-v22.15.0-linux-x64
source /etc/profile.d/nodejs.sh
node -v
npm -v
```

## Notes

- Default install path: `/opt/nodejs`
- Active symlink: `/opt/nodejs/current`
- To install into custom path:

```bash
sudo INSTALL_PREFIX=/srv/nodejs ./install-offline.sh ./bundle-node-v22.15.0-linux-x64
```
