# Setup with ddev

While not strictly necessary to run the node commands through `ddev`, there are some use cases that justifies it.&#x20;

There's a good blog post called [Drupal Radix Sub-theme Browsersync With DDEV](https://kentrichards.net/blog/drupal-radix-sub-theme-browsersync-ddev) by Kent Richards that you can read, but here's the gist:

Steps:

1. First set your `nodejs_version` to `` `lts/jod` `` so it is the same as your version defined in `.nvmrc` in the sub-theme

```bash
ddev nvm install lts/jod
```

Then re-run your `ddev`:

For ease of use, you can define a `ddev command` in `.ddev/commands/web/` and create a `watch` file (no extension needed) with the following:

```bash
#!/bin/bash

## Description: Installs nvm version and runs npm watch
## Usage: theme:watch
## Example: ddev theme:watch THEME_NAME

GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m\n' # set no color and line end

printf "${GREEN}Launching npm install inside ddev${NC}"

if [ -z "$1" ]; then
    echo "Please provide a theme name. Usage: ddev theme:watch THEME_NAME"
    exit 1
fi

cd web/themes/custom/$1
nvm alias default `cat .nvmrc`
npm run watch
```

Once that's done, you can run the **watch** command with: `ddev theme:watch THEME_NAME` . You may also create additional commands if you need them accordingly.

Special thanks to Nathan Kendall, Kent Richards, and others in [this issue](https://www.drupal.org/project/radix/issues/3476010)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trydrupal.com/radix/installation/setup-with-ddev.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
