# How to Install Dependencies for the AI For Beginners Quiz App

> Install dependencies for the AI For Beginners quiz app. Follow simple steps in the AI For Beginners repo to get Vue 2, Vue Router, and dev tools installed and the server running.

- Repository: [Microsoft/AI-For-Beginners](https://github.com/microsoft/AI-For-Beginners)
- Tags: how-to-guide
- Published: 2026-08-28

---

**TLDR:** Navigate to the `etc/quiz-app` directory in the microsoft/AI-For-Beginners repository and run `npm install` to install Vue 2, Vue Router, and development tools declared in **package.json**, then use `npm run serve` to start the development server.

The AI For Beginners quiz application is a Vue 2-based interactive tool located in the `etc/quiz-app` directory of the microsoft/AI-For-Beginners repository. To begin development or customize the quiz interface, you must first install dependencies for the AI For Beginners quiz app using the Node package manager.

## Prerequisites

Before installing, ensure you have **Node.js LTS version 14 or higher** installed on your system. The Vue CLI toolchain and peer dependency resolution require a recent LTS release to function correctly.

## Step 1: Navigate to the Quiz App Directory

All npm commands must be executed from within the `etc/quiz-app` folder so that the correct [`package.json`](https://github.com/microsoft/AI-For-Beginners/blob/main/package.json) is detected. From the repository root, change to the application directory:

```bash
cd etc/quiz-app

```

## Step 2: Install NPM Dependencies

Run the install command to resolve the exact versions listed in the project's **package.json**, which creates a `node_modules` directory containing the complete dependency tree:

```bash
npm install

```

This command installs runtime libraries including `vue`, `vue-router`, and `vue-i18n` under **dependencies**, alongside development tools such as `@vue/cli-service`, `eslint`, and `babel-eslint` under **devDependencies** as specified in the source configuration.

## Step 3: Verify the Installation

After installation completes, validate that the environment is configured correctly by running the linting script defined in **package.json**:

```bash
npm run lint

```

This executes ESLint to ensure the installed packages and codebase conform to the project's coding standards.

## Run the Development Server

Once dependencies are installed, start the hot-reloading development server:

```bash
npm run serve

```

This launches the application at `http://localhost:8080`, utilizing the installed `@vue/cli-service` to compile the Vue 2 source code.

## Build for Production

To compile the application for deployment:

```bash
npm run build

```

This outputs the production bundle to the `dist/` directory, processing the source through the Babel configuration defined in [`babel.config.js`](https://github.com/microsoft/AI-For-Beginners/blob/main/babel.config.js).

## Key Configuration Files

Understanding how the quiz app manages its requirements requires examining several critical files:

- **[`etc/quiz-app/package.json`](https://github.com/microsoft/AI-For-Beginners/blob/main/etc/quiz-app/package.json)** — Declares all runtime and build-time dependencies, including the exact versions of Vue 2, Vue Router, and internationalization libraries, plus npm scripts for `serve`, `build`, and `lint`.

- **[`etc/quiz-app/README.md`](https://github.com/microsoft/AI-For-Beginners/blob/main/etc/quiz-app/README.md)** — Contains the official setup instructions that document the `npm install` command and additional usage details for the quiz application.

- **[`etc/quiz-app/babel.config.js`](https://github.com/microsoft/AI-For-Beginners/blob/main/etc/quiz-app/babel.config.js)** — Configures the Babel transpiler that processes modern JavaScript for browser compatibility, utilized by the Vue CLI service during both development and production builds.

- **[`etc/quiz-app/src/main.js`](https://github.com/microsoft/AI-For-Beginners/blob/main/etc/quiz-app/src/main.js)** — The application entry point that initializes the Vue instance and wires together installed packages like `vue-router` and `vue-i18n`.

- **[`etc/quiz-app/src/router/index.js`](https://github.com/microsoft/AI-For-Beginners/blob/main/etc/quiz-app/src/router/index.js)** — Configures client-side routing using the `vue-router` dependency installed from **package.json**.

## Summary

- The quiz application resides in `etc/quiz-app` and requires Node.js LTS ≥ 14.
- Execute `npm install` from the `etc/quiz-app` directory to install Vue 2, Vue Router, and development tools listed in **package.json**.
- Verify the setup with `npm run lint` to ensure the ESLint configuration loads properly.
- Use `npm run serve` for local development at `localhost:8080` and `npm run build` for production deployment to the `dist/` folder.
- Critical configuration files include **package.json**, **babel.config.js**, and the entry points in **src/main.js** and **src/router/index.js**.

## Frequently Asked Questions

### What Node.js version is required to install dependencies for the AI For Beginners quiz app?

The installation process requires Node.js LTS version 14 or higher. While the application may function on newer versions, using a recent LTS release ensures compatibility with the Vue CLI toolchain and proper peer dependency resolution.

### Where must I run the npm install command for the quiz app?

You must run `npm install` from within the `etc/quiz-app` directory specifically. Running the command from the repository root will fail because npm locates the **package.json** file relative to the current working directory, and the quiz app's dependencies are isolated in the `etc/quiz-app` subdirectory.

### How do I handle permission errors during npm install on Linux or macOS?

If you encounter permission issues during installation, use a Node version manager such as **nvm** to manage Node.js versions without requiring elevated privileges. Alternatively, you can append the `--legacy-peer-deps` flag to the install command, though the default configuration normally installs without additional flags on properly configured systems.

### Can I run the quiz app immediately after installing dependencies?

Yes, once `npm install` completes successfully, you can immediately start the development server by running `npm run serve` from the same `etc/quiz-app` directory. This command utilizes the installed `@vue/cli-service` to compile the Vue 2 application and serve it at `http://localhost:8080` with hot-reloading enabled.