# Run and debug Angular applications

> **TL;DR**
> Available only in IntelliJ IDEA with the Ultimate subscription: [download](https://www.jetbrains.com.cn/en-us/idea/download/) to try or [explore the features](https://www.jetbrains.com.cn/en-us/products/compare/?product=idea&product=idea-ult).
>
>
>
>
>
> Required plugins:
>
>
>
> `JavaScript and TypeScript` -    the plugin is bundled with IntelliJ IDEA and enabled by default.
>
>
>
> `Angular and AngularJS`, `JavaScript Debugger` -    install the plugins on the Settings | Plugins page, tab Marketplace.     The plugins are available only in IntelliJ IDEA with the Ultimate subscription.

## Before you start

Procedure:

1. Download and install [Node.js](http://nodejs.org/#download).

2. Make sure the  JavaScript and TypeScript plugin is enabled in the settings.  Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Plugins`.  Click the Installed tab. In the search field, type JavaScript and TypeScript. For more information about plugins, refer to [Managing plugins](managing-plugins.html).

3. Install the Angular and AngularJS and JavaScript Debugger plugins on the Settings | Plugins page, tab Marketplace, as described in [Installing plugins from
JetBrains Marketplace](managing-plugins.html#install_plugin_from_repo).     The plugins are available only in IntelliJ IDEA with the Ultimate subscription.

## Run an Angular application

Procedure:

1. Сlick ![the Run icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.run.run.svg) in the gutter next to the `start` script in `package.json`, or execute the `npm run start` command in the Terminal `Alt+F12` (Windows), `⌥ F12` (macOS), `⌥ F12` (IntelliJ IDEA Classic (macOS)), `⌘ ⌃ T` (macOS System Shortcuts), `Alt+F12` (XWin), `Alt+F12` (GNOME), `Alt+F12` (KDE), `Alt+F12` (Emacs), `Alt+F12` (Sublime Text), `⌥ F12` (Sublime Text (macOS)), `Alt+F12` (NetBeans), `Ctrl+Alt+1` (Visual Studio), `⌘ ⌃ 1` (Visual Studio (macOS)), `Alt+F12` (Eclipse), `⌥ F12` (Eclipse (macOS)), or double-click the `start` task in the [npm tool window](npm-tool-window.html) (`View | Tool Windows | npm`).

![Run an Angular app in the development mode from package.json](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_angular_run_dev_mode_package_json.animated.gif)

2. Wait till the application is compiled and the development server is ready.

The Run tool window or the Terminal shows the URL at which your application is running. If your application was generated with @angular/cli, the default URL is `http://localhost:4200/`.  Click this link to view the application.

![Running Angular CLI app: the Development server is ready](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_angular_run_dev_server_ready.png)

### Run an Angular application via a run/debug configuration

For applications created with Angular CLI in the IntelliJ IDEA New Project wizard [as described above](angular.html#create_new_angular_app), IntelliJ IDEA generates an [npm](run-debug-configuration-npm.html) configuration  with the default name Angular CLI Server. This configuration runs the `ng serve` command that launches the development server and starts your application in the development mode.

In other cases, you need to [create a
run/debug configuration](#angular_running_and_debugging_run_via_rc_create_rc) with the actual settings, such as, host, port, etc., manually.

Procedure: Create an npm run/debug configuration

1. Go to `Run | Edit Configurations`. Alternatively, select Edit Configurations from the Run widget on the toolbar.

![Open the Edit Configurations dialog](https://resources.jetbrains.com.cn/help/img/idea/2026.2/angular_run_config_create.png)

In the Edit Configurations dialog that opens,

click the Add button (![the Add button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg)) on the toolbar and select npm from the list.

2. In the Configuration tab of the Run/Debug Configurations: npm dialog that opens, specify the location of the `package.json`, the Node.js runtime, and the package manager to use.

In the Command field, select run from the list and then select the script to run from the Scripts list. Most likely it will be the default `start` script but you can configure another one in your `package.json`, for example, to run the application on a custom port.

![npm run/debug configuration](https://resources.jetbrains.com.cn/help/img/idea/2026.2/angular_debug_npm_rc.png)

3. Optionally:

To open the application in the browser, update the configuration as follows: in the Browser / Live Edit tab, select the After launch checkbox, select the browser to open the application in, and specify the URL address at which the application wil run.

If you are going to debug the application, select [Google Chrome](http://www.google.com/chrome/) or another [Chromium-based browser](https://www.chromium.org/).

![Browser / Live Edit tab: select browser](https://resources.jetbrains.com.cn/help/img/idea/2026.2/angular_run_rc_browser_tab_select_browser.png)

Procedure: Run an application

1. From the list in the Run widget  on the toolbar, select a run configuration of the type npm. This can be the autogenerated Angular CLI Server configuration or a custom one that you created yourself [as described
above](#angular_running_and_debugging_run_via_rc_create_rc).

2. Click ![Run](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.actions.execute.svg).

![Run an Angular app in the development mode via a run/debug configuration](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_angular_run_dev_mode.png)

3. Wait till the application is compiled and the development server is ready.

The Run tool window or the Terminal shows the URL at which your application is running. If your application was generated with @angular/cli, the default URL is `http://localhost:4200/`.  Click this link to view the application.

![Running Angular CLI app: the Development server is ready](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_angular_run_dev_server_ready.png)

Alternatively, enable IntelliJ IDEA to open the application on start [as
described above](#ws_angular_start_app_in_dev_mode_enable_opening_browser).

> **Note:**
> When the development server is running, your application is automatically reloaded as soon as you change any of the source files and save the updates.

## Debug an Angular application

> **Note:**
> Debugging of Angular applications is only supported in [Google Chrome](http://www.google.com/chrome/) and in other [Chromium-based browsers](https://www.chromium.org/).

You can start a debugging session either by [launching a
run/debug configuration](#angular_debug_with_rc) or [from the Run tool
window](#angular_debug_from_tw) that shows the URL at which your application is running in the development mode.

### Start debugging via a run/debug configuration

To debug your Angular application, you need two run/debug configurations:

* An npm configuration to start your application in the development mode, [as described above](#angular_running_and_debugging_run).

* A JavaScript Debug configuration to attach the debugger to the application that is running in the development mode. > **Note:** > If you generated your application with Angular CLI, [as described above](angular.html#create_new_angular_app), IntelliJ IDEA has already generated these two run/debug configurations.

You can create a JavaScript Debug configuration within the npm configuration to launch them at once, as described in [Run and debug an
Angular application with an npm run/debug configuration](#angular_debug_two_rc).

Alternatively, launch an npm and a JavaScript Debug run/debug configurations separately, as described in [Start debugging with a JavaScript Debug run/debug configuration](#angular_debug_via_js_debug_rc).

Procedure: Run and debug an Angular application with a single npm run/debug configuration

1. Set the [breakpoints](using-breakpoints.html) in your code.

2. Create an npm configuration [as described
above](#angular_running_and_debugging_run_via_rc_create_rc).

> **Note:**
> If you generated your application with `Angular CLI`, IntelliJ IDEA has already created an npm configuration with the default name Angular CLI Server. The configuration is available from the Run widget and in the Run/Debug Configurations dialog.

3. In the Configuration tab of the Run/Debug Configurations: npm dialog that opens, specify the location of the `package.json`, the Node.js runtime, and the package manager to use.

In the Command field, select run from the list and then select the script to run from the Scripts list. Most likely it will be the default `start` script but you can configure another one in your `package.json`, for example, to run the application on a custom port.

![npm run/debug configuration](https://resources.jetbrains.com.cn/help/img/idea/2026.2/angular_debug_npm_rc.png)

4. In the Browser / Live Edit tab, select the After launch checkbox, select [Google Chrome](http://www.google.com/chrome/) or another [Chromium-based browser](https://www.chromium.org/) from the list, select the with JavaScript debugger checkbox, and then specify the URL at which your application will run.

![npm configuration, Browser tab](https://resources.jetbrains.com.cn/help/img/idea/2026.2/angular_debug_npm_rc_browser_tab.png)

5. Click Run.

To re-run the configuration, select it from the list in the  Run widget and click ![Run](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.actions.execute.svg) next to it.

IntelliJ IDEA runs the application in the development mode and at the same time launches a debugging session.

![Debugging session](https://resources.jetbrains.com.cn/help/img/idea/2026.2/angular_debug_npm_rc_debugging_session.png)

6. When the first breakpoint is hit, switch to the [Debug tool window](debug-tool-window.html) and   proceed as usual: [step through the program](stepping-through-the-program.html),  [stop
and resume](starting-the-debugger-session.html#pause-resume)  program execution, [examine it when suspended](examining-suspended-program.html), explore the call stack and variables, set watches, evaluate variables, [view actual HTML DOM](viewing-actual-html-dom.html), and so on.

To ignore source maps and step through the actually executed code, press ![the Disable Source Maps toggle button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/sourceMapDisable.png) on the toolbar of the Debug tool window.

Procedure: Start debugging with a JavaScript Debug run/debug configuration

1. Set the [breakpoints](using-breakpoints.html) in your code.

2. Start the application in the development mode [as described above](#ws_angular_start_app_in_dev_mode) and wait till the application is compiled and the development server is ready.

The Run tool window or the Terminal shows the URL at which your application is running. Copy this URL to [specify it later
in the JavaScript Debug
configuration](#angular_debug_specify_URL).

![Angular app is running in the development mode](https://resources.jetbrains.com.cn/help/img/idea/2026.2/angular_run_app_url.png)

3. Create a JavaScript Debug configuration. To do that, go to `Run | Edit Configurations` in the main menu, click ![the Add icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg), and select JavaScript Debug from the list.

If you generated your application with Angular CLI,  [as described above](angular.html#create_new_angular_app),  IntelliJ IDEA has already created a JavaScript Debug run/debug configuration with the default name Debug Application and the default URL `http://localhost:4200`. Select this run/debug configuration from the list under the JavaScript Debug node.

![Select the generated JavaScript debug run/debug configuration](https://resources.jetbrains.com.cn/help/img/idea/2026.2/angular_debug_select_js_debug_rc.png)

4. In the Run/Debug Configurations: JavaScript Debug dialog that opens, specify the name of the configuration and the URL address at which the application is running in the development mode. You can copy this URL in the Run tool window or in the Terminal, [as described above](#angular_debug_dev_mode_URL).

![Create a JavaScript Debug configuration: specify the URL](https://resources.jetbrains.com.cn/help/img/idea/2026.2/angular_debug_create_js_debug_rc.png)

> **Note:**
> If you are using the autogenerated configuration, make sure the specified URL address is the one at which your application is actually running.

5. Click Debug.

To re-run the configuration, select it from the list in the  Run widget and click ![Debug](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.run.debug.svg) next to it.

![Run a JavaScript Debug configuration from the Run widget](https://resources.jetbrains.com.cn/help/img/idea/2026.2/angular_debug_rerun_js_debug_rc.png)

6. When the first breakpoint is hit, switch to the [Debug tool window](debug-tool-window.html) and   proceed as usual: [step through the program](stepping-through-the-program.html),  [stop
and resume](starting-the-debugger-session.html#pause-resume)  program execution, [examine it when suspended](examining-suspended-program.html), explore the call stack and variables, set watches, evaluate variables, [view actual HTML DOM](viewing-actual-html-dom.html), and so on.

To ignore source maps and step through the actually executed code, press ![the Disable Source Maps toggle button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/sourceMapDisable.png) on the toolbar of the Debug tool window.

### Start debugging from the Run tool window or from the built-in Terminal

If your application is running in the development mode on `localhost`, in particular, if it was generated with Angular CLI, you can launch a debugging session right from the >Run tool window or from the built-in Terminal.

Procedure:

1. Set the [breakpoints](using-breakpoints.html) in your code.

2. Start the application in the development mode [as described above](#angular_running_and_debugging_run) and wait till the application is compiled and the development server is ready.

3. The Run tool window or the Terminal shows the URL at which your application is running. If your application was generated with @angular/cli, the default URL is `http://localhost:4200/`.    Hold `Ctrl+Shift` (Windows), `Ctrl+Shift` (macOS), `Ctrl+Shift` (IntelliJ IDEA Classic (macOS)), `Ctrl+Shift` (macOS System Shortcuts), `Ctrl+Shift` (XWin), `Ctrl+Shift` (GNOME), `Ctrl+Shift` (KDE), `Ctrl+Shift` (Emacs), `Ctrl+Shift` (Sublime Text), `Ctrl+Shift` (Sublime Text (macOS)), `Ctrl+Shift` (NetBeans), `Ctrl+Shift` (Visual Studio), `Ctrl+Shift` (Visual Studio (macOS)), `Ctrl+Shift` (Eclipse), `Ctrl+Shift` (Eclipse (macOS)) and click this URL link. IntelliJ IDEA starts a debugging session with an automatically generated Angular Application configuration of the type [JavaScript Debug](run-debug-configuration-javascript-debug.html).

![Starting a debugging session from the Run tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_angular_start_debug_from_run_tw.animated.gif)

Alternatively, select the autogenerated Angular Application configuration from the list and click the Debug button ![the Debug button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.run.debug.svg) next to the list.

If you launched your application in the development mode from the [New Terminal](terminal-emulator.html), you can just click the Start debugging in browser button next to the link.

![New Terminal: the Start debugging Angular in browser button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_angular_start_debugging_from_new_terminal_start_debugging_button.png)

By default, the button is not shown. To have it displayed,   open the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))), go to `Advanced Settings`, and select the Show 'Start Debugging in Browser' button for localhost links in the Terminal checkbox in the JavaScript and TypeScript area.

> **Note:**
> The button is not available from the New Terminal in the WSL.

When the first breakpoint is hit, switch to the [Debug tool window](debug-tool-window.html) and   proceed as usual: [step through the program](stepping-through-the-program.html),  [stop
and resume](starting-the-debugger-session.html#pause-resume)  program execution, [examine it when suspended](examining-suspended-program.html), explore the call stack and variables, set watches, evaluate variables, [view actual HTML DOM](viewing-actual-html-dom.html), and so on.

To ignore source maps and step through the actually executed code, press ![the Disable Source Maps toggle button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/sourceMapDisable.png) on the toolbar of the Debug tool window.

### Troubleshooting for Node.js 17+

If you are using Node.js version 17 or later, during a debugging session you may face network connectivity issues that result in problems with attaching the debugger or with loading sourcemaps.

The workaround is to pass `--host 127.0.0.1` to the server by updating the `start` script in your `package.json` as follows:

```JSON
"start": "ng serve --host=127.0.0.1"
```

