Install Ionic Framework on Ubuntu 22.04 LTS – Fast‑Track Your Cross‑Platform Apps
You’ll learn how to get the Ionic CLI up and running on a clean Ubuntu 22.04 LTS install, so you can start building hybrid apps without wrestling with Node or permission quirks.
Why Node?
Ionic is just a wrapper around Capacitor/Angular/React; it needs a modern JavaScript runtime. The easiest way to keep that tidy is through nvm (Node Version Manager). It keeps your global packages isolated and lets you bump Node without touching the system.
Install nvm first
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
Close and reopen your terminal, or source `~/.bashrc`.
If you skip this, the system’s default Node (apt‑installed) is often 18.x but lacks the npm version that Ionic prefers, leading to broken dependencies.
Grab the latest LTS Node
nvm install --lts nvm use --lts
Confirm with `node -v` and `npm -v`.
Ionic’s tooling expects an up‑to‑date npm (≥ 9) to resolve peer dependencies correctly. Using a too‑old Node will make the CLI spit out “missing peer dependency” errors.
Install the Ionic CLI globally
npm install -g @ionic/cli
The `-g` flag places the `ionic` command in your `$PATH`, so you can run it from any directory. Without it, you’d have to prepend `npx ionic …` every time.
Verify the installation
ionic --version
You should see a number like `6.2.0`. If not, try:
npm cache clean --force npm install -g @ionic/cli
Common hiccups
- Permission errors – I once ran into “EPERM: operation not permitted” when installing the CLI after using the system’s default Node from `apt`. Switching to nvm and deleting the old npm folder (`~/.npm`) cleared that.
- Missing `capacitor` – If you see “cannot find module ‘@capacitor/core’”, run `ionic integrations enable capacitor` inside a new project. The CLI will scaffold it for you.
Starting your first app
ionic start myApp tabs --type=react cd myApp ionic serve
Open `http://localhost:8100`; the dev server hot‑reloads as you edit. If you’re using Angular or Vue, swap `--type` accordingly.
Keep it tidy
Use `nvm uninstall 18` (or whichever version you don’t need) to avoid clutter. And if you ever drop into a fresh Ubuntu install again, just repeat steps 1‑4—no extra fuss.
Hope that helps