# How to Deploy a Vue 3 App with Vue Router and TypeScript on Light Cloud

To deploy a Vue 3 app on Light Cloud, push it to GitHub, choose **Deploy from GitHub** in the console and click **Deploy**. Light Cloud detects Vue from `package.json`, runs `npm ci` and your `build` script, and serves the `dist` folder from the edge. Vue Router's history mode works without any configuration: a link like `/about` opened directly still loads the app.

In my run the first deploy, TypeScript check included, took 33 seconds.

## What you will build

The official Vue starter with Vue Router and TypeScript, live on a `light-cloud.io` address, including a working direct link to its About page.

![The Vue starter page served by Light Cloud: You did it! with Home and About links](/assets/blog/deploy-a-vue-app/v-05-live-site.webp)

Live demo: [main-tutorial-vue-website-examples.light-cloud.io](https://main-tutorial-vue-website-examples.light-cloud.io). Source code: [github.com/light-cloud-com/tutorial-vue-website](https://github.com/light-cloud-com/tutorial-vue-website).

## Before you start

- [Node.js](https://nodejs.org/) 22.18 or later, or 24.12 or later. This is what [create-vue](https://github.com/vuejs/create-vue) 3.24 requires; I used Node.js 24.
- [Git](https://git-scm.com/downloads) and a [GitHub](https://github.com/) account.
- A free Light Cloud account at [console.light-cloud.com](https://console.light-cloud.com) with GitHub connected.
- On Windows, use [PowerShell 7](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows).

New to deploying from GitHub? The [React guide](/tutorials/deploy-a-react-app) walks through the same console screens in more detail.

## Step 1: Create the Vue app

`--router` adds Vue Router and `--default` accepts the recommended defaults, which include TypeScript:

```shell os="macOS,Linux"
$ npm create vue@latest tutorial-vue-website -- --router --default
┌  Vue.js - The Progressive JavaScript Framework

Scaffolding project in /Users/you/tutorial-vue-website...
│
└  Done. Now run:

   cd tutorial-vue-website
   npm install
   npm run dev
```

```shell os="Windows"
PS> npm create vue@latest tutorial-vue-website -- --router --default
┌  Vue.js - The Progressive JavaScript Framework

Scaffolding project in C:\Users\you\tutorial-vue-website...
│
└  Done. Now run:

   cd tutorial-vue-website
   npm install
   npm run dev
```

The path in the output is your own folder.

## Step 2: Run it and build it once

```shell os="macOS,Linux"
$ cd tutorial-vue-website
$ npm install
found 0 vulnerabilities
$ npm run build
vite v8.3.1 building client environment for production...
✓ 43 modules transformed.
dist/index.html                      0.42 kB │ gzip:  0.28 kB
dist/assets/index-kyaxwdja.js       97.36 kB │ gzip: 37.58 kB
✓ built in 374ms
```

```shell os="Windows"
PS> cd tutorial-vue-website
PS> npm install
found 0 vulnerabilities
PS> npm run build
vite v8.3.1 building client environment for production...
✓ 43 modules transformed.
dist/index.html                      0.42 kB │ gzip:  0.28 kB
dist/assets/index-kyaxwdja.js       97.36 kB │ gzip: 37.58 kB
✓ built in 374ms
```

Output is trimmed. `npm run build` first type-checks the project with `vue-tsc`, then builds it; a clean local build means the deploy will build too. `npm run dev` starts the development server on `http://localhost:5173`.

## Step 3: Push it to GitHub

```shell os="macOS,Linux"
$ git init -b main
$ git add -A
$ git commit -m "Vue website from create-vue"
# Create an empty repository named tutorial-vue-website on github.com/new first.
$ git remote add origin https://github.com/YOUR-USERNAME/tutorial-vue-website.git
$ git push -u origin main
To https://github.com/YOUR-USERNAME/tutorial-vue-website.git
 * [new branch]      main -> main
branch 'main' set up to track 'origin/main'.
```

```shell os="Windows"
PS> git init -b main
PS> git add -A
PS> git commit -m "Vue website from create-vue"
# Create an empty repository named tutorial-vue-website on github.com/new first.
PS> git remote add origin https://github.com/YOUR-USERNAME/tutorial-vue-website.git
PS> git push -u origin main
To https://github.com/YOUR-USERNAME/tutorial-vue-website.git
 * [new branch]      main -> main
branch 'main' set up to track 'origin/main'.
```

## Step 4: Deploy it

1. In the [Light Cloud console](https://console.light-cloud.com), click **New...**, then **Deploy from GitHub**.
2. Search for `tutorial-vue-website` and click it.

Light Cloud shows **Vue / Frontend**, based on `package.json` and `package-lock.json`, and **Served from the edge**:

![The detection banner Vue Frontend with Served from the edge highlighted](/assets/blog/deploy-a-vue-app/v-01-vue-detected.webp)

3. Optional: under **Advanced - build settings, environment variables, domain, scaling** you can see the build Light Cloud will run: `npm ci`, `npm run build`, output `dist`. Nothing to change.

![The Advanced section with npm ci, dist and npm run build highlighted](/assets/blog/deploy-a-vue-app/v-02-build-settings.webp)

4. Click **Deploy** and wait for **Deployed**. Then open the address from the **URL** card:

![The Production overview with the Deployed badge and the URL card highlighted](/assets/blog/deploy-a-vue-app/v-03-deployed-overview.webp)

## Step 5: Open a deep link

create-vue sets up Vue Router in history mode, so the About page lives at a real-looking path, `/about`, not `/#/about`. On many static hosts, opening that path directly returns a 404, because there is no `about` file. On Light Cloud it works: any path that is not a file is answered with `index.html`, and Vue Router takes over.

Open `https://main-tutorial-vue-website-yourworkspace.light-cloud.io/about` directly:

![The About page opened directly at /about, showing This is an about page](/assets/blog/deploy-a-vue-app/v-06-about-direct.webp)

From now on, every push to `main` redeploys the site by itself.

## Troubleshooting

### npm error engine Unsupported engine

```text
npm error notsup Required: {"node":"^22.18.0 || >=24.12.0"}
npm error notsup Actual:   {"node":"v22.16.0","npm":"11.6.4"}
```

Your Node.js is older than create-vue needs. Install a current Node.js 22 or 24 from [nodejs.org](https://nodejs.org/) and run the command again.
