Building an Ionic app in Visual Studio Code means combining three moving parts: Node.js and the Ionic CLI on your machine, a project scaffold that matches the framework version you intend to use, and VS Code extensions that let the editor understand TypeScript, Angular, React, or Vue code alongside Ionic's web components. The key condition is version alignment. As of the late-2026 toolchain described here, Ionic CLI 7 generates projects against Ionic Framework 8, and mismatched Node or framework versions cause most "it won't build" failures.
The steps below walk from a clean machine to a production web build and a native Android or iOS build, with the checks that tell you each stage actually worked.
Prerequisites: what must be in place before the first command
Ionic itself is a UI framework plus a set of native wrappers; it is not an installed application you launch like a word processor. The CLI is a Node package, so Node.js is the real foundation. Install the current LTS release of Node.js (at the time of writing, the Node 22 LTS line) rather than the newest "current" release, because native build tooling and some Cordova/Capacitor plugins lag behind the bleeding edge. Node 20 LTS also works for most projects; anything older than Node 18 is not worth fighting with.
You also need:
npm, which ships with Node. Confirm it resolves. Git, optional for Ionic but effectively mandatory for real projects and for VS Code's source control panel. A native toolchain only if you plan to run on a device or emulator: Android Studio with an SDK and an emulator image for Android, or Xcode on macOS for iOS. You cannot build an iOS binary on Windows or Linux; the iOS path requires a Mac. VS Code installed, ideally the current stable release.
A quick sanity check in a terminal (PowerShell on Windows, Terminal on macOS/Linux):
Expect something like v22.x.x and 10.x.x. If node is not recognized, the installer did not add Node to your PATH; reinstall with the default options or fix PATH before continuing. This is the most common place people stall, and it has nothing to do with Ionic.
Install the Ionic CLI and confirm it runs
The Ionic CLI is the scaffolding and dev-server tool. Install it globally so the ionic command is available everywhere:
The version output (7.x at the time of writing) confirms a working install. If the command is not found, npm's global bin directory is not on your PATH; npm config get prefix shows where global packages land, and that directory's bin (or the prefix itself on Windows) must be in PATH.
One nuance worth knowing: the CLI version and the framework version are separate numbers. CLI 7 scaffolds projects that depend on Ionic Framework 8. If you are maintaining an older app pinned to Framework 7, the CLI still works, but ionic start will give you a current-version project, so for legacy work you either clone the existing repo or pin dependency versions manually after scaffolding.
Create the project with the right framework flavor
Ionic supports four UI frameworks: Angular, React, Vue, and a plain JavaScript/web-components option. Pick the one your team actually knows; the Ionic components behave the same, but project structure and build tooling differ substantially.
Interactive scaffolding:
The CLI prompts for the framework and then asks whether to enable standalone components (Angular), whether to add Capacitor for native builds, and whether to create a free Ionic account for live app previews. Answering "yes" to Capacitor is convenient; you can also add it later. For a non-interactive run:
Valid --type values include angular, react, vue, and vanilla. The blank template is a single page; tabs and sidemenu give you navigation structure out of the box and are better starting points for anything beyond a demo.
When it finishes, the CLI prints the folder path and next commands. Change into it:
Success check: the folder contains package.json, ionic.config.json, a src directory, and (if you chose Capacitor) a capacitor.config.ts. If ionic start failed partway, delete the half-created folder and rerun rather than trying to patch it; partial scaffolds produce confusing errors later.
Open the project in VS Code and install the extensions that matter
From the project root:
If code is not recognized, open VS Code, run the command palette action "Shell Command: Install 'code' command in PATH," and retry.
VS Code needs very little to handle an Ionic project well, because the underlying language servers do the heavy lifting. Worth installing:
Angular Language Service for Angular projects, or Vue - Official for Vue, or the built-in TypeScript support for React. These give template type-checking and autocomplete inside component templates, which is where most Ionic markup lives. ESLint so lint errors surface inline. Ionic VS Code Extension Pack, an optional convenience bundle that adds snippets and documentation hover for Ionic components. It is helpful but not required; the project builds fine without it. Prettier if your team uses it, wired to format on save.
Avoid stacking multiple competing formatters or linters; pick one configuration and let it own the files. Conflicting format-on-save setups are a frequent source of noisy diffs.
Success check: open a component file and confirm you get autocomplete for ion- tags and that TypeScript errors appear as you type. If autocomplete is dead, the language service extension for your framework is missing or the workspace has not finished indexing.
Run the dev server and verify hot reload
The universal command is:
This starts a development server (default port 8100) and opens a browser. Edits to source files trigger a live reload. If you want the lab view that shows the app at phone and tablet dimensions side by side, ionic serve --lab does that, though it adds overhead and is best used occasionally.
For a specific port or to bind to your LAN so a physical phone on the same Wi-Fi can load the dev build:
Success check: the browser shows your app, and changing a string in a page component updates the browser within a second or two. If the page is blank, open the browser dev console; the error there (often a missing dependency or a template syntax error) tells you what the terminal sometimes does not.
A useful detail: ionic serve runs the framework's own dev server underneath (Angular CLI, Vite for React/Vue, or the web-components dev server), so framework-specific flags sometimes need to be passed through. When in doubt, the framework's own docs for the dev server apply.
Understand the source layout before you write features
The structure differs by framework but the shape is consistent:
src/app (Angular) or src/pages/src/components (React/Vue) holds pages and components. src/theme/variables.css holds the Ionic theming variables; color changes go here rather than in component styles. src/global.scss or equivalent holds global styles. capacitor.config.ts holds the app ID, app name, and web directory for native builds. ionic.config.json holds CLI metadata.
Ionic pages are ordinary framework components that use ion- prefixed custom elements. A minimal page body looks like this in any framework:
Navigation is where frameworks diverge: Angular uses @ionic/angular's router integration, React uses @ionic/react-router wrapping React Router, and Vue uses the Ionic Vue router plugin. Follow your framework's routing docs rather than mixing patterns; a React Router setup bolted onto Ionic React without the Ionic wrappers loses page transitions and back-button behavior.
Success check: add a second page, link to it, and confirm the transition animates and the browser back button works. That verifies routing is wired, not just rendering.
Build the web bundle
The production web build is the artifact Capacitor packages into a native app, and it is also what you deploy if you ship as a progressive web app.
Add --prod for an optimized build (historically the flag that enabled minification and AOT; in current CLI versions production optimization is largely the default for ionic build, and the flag is accepted for compatibility). The output lands in www/ for Angular and Vue projects and dist/ or build/ for React depending on configuration; ionic build prints the actual output path, and capacitor.config.ts's webDir must match it. A mismatch here is the single most common native-build failure: Capacitor copies an empty or stale directory and the app shows a blank screen.
Success check: the output directory exists, contains an index.html, and npx cap copy (after adding a platform) reports copying files without errors.
Add native platforms with Capacitor and run on a device
Capacitor is the modern native runtime; Cordova still works but is legacy. Assuming you enabled Capacitor at scaffold time:
cap sync does two things: copies the web build into the native projects and updates native plugin dependencies. Run it after every web build. Then open the native project:
This launches Android Studio with the generated project. Let Gradle sync, pick an emulator or connected device, and press Run. For iOS, npx cap open ios opens Xcode; you need a signing team configured even for a simulator run in some configurations, and a physical device run always requires signing.
A streamlined loop many teams use: ionic capacitor run android --livereload serves the dev build to a device over the network so you get hot reload on hardware. It requires the device and computer on the same network and the server.url configuration Capacitor sets automatically; if the device shows a connection error, the firewall or a mismatched host IP is the usual cause.
Success check: the app launches on the emulator, the toolbar renders with correct safe-area spacing, and the hardware back button behaves. If you see a white screen, check webDir in capacitor.config.ts, confirm www/ (or your output folder) has content, and rerun npx cap sync.
Fix the failures that actually happen
Most build problems fall into a handful of buckets, and the fix order matters because later errors are often caused by earlier ones.
Node version mismatch. Symptoms: install scripts fail, or the dev server crashes with syntax errors in dependencies. Check node --version against the framework's supported range and switch with a version manager (nvm, fnm, or nvm-windows) rather than reinstalling Node globally.
Dependency tree conflicts. Symptoms: npm install fails with peer dependency errors. Try deleting node_modules and package-lock.json and reinstalling; if the conflict persists, read the actual peer range rather than reaching for --force, which installs a tree that may fail at runtime.
Blank native screen. Symptoms: emulator shows nothing. Verify webDir, rerun ionic build && npx cap sync, and check the native log (Logcat in Android Studio, the Xcode console for iOS) for a failed asset load.
Plugin not working after install. Symptoms: a Capacitor plugin's methods throw or return undefined. Run npx cap sync again; native plugin registration happens during sync, not at npm install time.
TypeScript errors only in VS Code. Symptoms: terminal build passes but the editor shows red. The editor's TypeScript version or workspace indexing is stale; run "TypeScript: Restart TS Server" from the command palette.
Stop condition: if the Android build fails inside Gradle with SDK or JDK errors, and you have already confirmed the SDK path in Android Studio and the JDK version Gradle expects, stop adjusting the Ionic project. Those are native toolchain configuration problems best resolved with Android's own setup documentation or a colleague who owns the native build; continuing to change app code will not fix them.
A realistic build sequence to follow every time
Once the first setup is done, the repeatable loop is short:
1: ionic serve while developing UI and logic in the browser. 2: ionic build when you want to check the production bundle. 3: npx cap sync to push the bundle and plugin changes into native projects. 4: npx cap run android or open the IDE for device testing. 5: Lint and test (npm run lint, npm test if the scaffold included tests) before committing.
The order is not arbitrary: cap sync without a fresh ionic build ships the previous bundle, which is why a change "doesn't appear" on the device even though it is in the source.
Trade-offs worth deciding early
Capacitor versus Cordova. Capacitor is the current path, has first-party plugin support, and lets you drop native code in without leaving the native project structure. Cordova has a longer plugin tail for obscure hardware, but new projects should default to Capacitor and only reach for Cordova plugins through Capacitor's compatibility layer when nothing else exists.
PWA versus native packaging. If your app does not need device APIs, shipping the web build as a PWA skips the entire native toolchain and both app stores. The cost is weaker access to hardware, no store presence, and browser-dependent install behavior. Decide this before investing in store accounts and signing certificates.
Framework choice. Angular gives the most opinionated structure and the deepest Ionic integration historically; React has the largest hiring pool; Vue is the lightest to learn. Switching later means a rewrite, so choose for the team, not for a benchmark.
Rough timeline for a first build
On a machine with Node already installed, the fast path is roughly: 2–5 minutes for the global CLI install and scaffold, a few minutes for npm install inside the project, and under a minute for the first ionic serve. The web build is typically well under two minutes for a starter app. The variable is native setup: installing Android Studio plus an SDK and emulator image commonly takes 20–60 minutes on a fresh machine, and the first Gradle build can take several minutes while it downloads dependencies. Budget an afternoon for a genuinely clean machine, most of it native tooling.
FAQ
Do I need Android Studio just to preview the app? No. ionic serve previews in a desktop browser, and browser device emulation in VS Code's built-in browser tools or Chrome DevTools covers most layout work. Android Studio is only needed for emulator or device runs and for producing installable binaries.
Can I build iOS apps on Windows? Not the native binary. You can develop and run the web build anywhere, but compiling and signing an iOS app requires Xcode on macOS. Cloud build services exist, but they add configuration and cost, so plan for a Mac if iOS is a real target.
Why does my app show old content after I change code? Almost always a stale bundle on the native side. Run ionic build followed by npx cap sync; the native project only receives what the last web build produced.
Is the Ionic CLI the same as Capacitor? No. The CLI scaffolds projects and runs the dev server; Capacitor is the runtime that packages the web build into native shells. You can use Capacitor without the Ionic CLI (plain npm scripts work), but the CLI streamlines the common commands.