Installation

Requirements

  • Node.js 18 or higher — download here
  • npm 9+ (comes with Node.js)
  • A terminal

Check your versions:

node --version   # should be >= 18
npm --version    # should be >= 9

Install dependencies

From your project root:

npm install

This installs Astro, the MDX integration, and Expressive Code for syntax highlighting.

Start the dev server

npm run dev

Open http://localhost:4321. The dev server hot-reloads on every file save.

Build for production

npm run build

The output goes to dist/. Preview it locally with:

npm run preview

Dependency overview

graph TD A[Your Markdown Files] --> B[Astro Build] B --> C[astro/mdx] B --> D[Shiki Syntax Highlighting] B --> E[Your BaseLayout.astro] C --> F[Static HTML in /dist] D --> F E --> F F --> G[Cloudflare Pages CDN]

Updating Astro

npx @astrojs/upgrade

This interactive tool upgrades Astro and official integrations safely.