Installation
The GOV.UK theme contains full compiled CSS and works out-of-the-box. You only need Node.js if you want to modify and compile the theme’s Sass files.
The current v3.1.x branch of GOV.UK Theme targets GOV.UK Frontend v6.
Detailed install for Ubuntu / Debian / macOS
The following steps work for Debian/Ubuntu and macOS. On Windows, install Node.js from the official website: https://nodejs.org.
1. Check Node.js and npm
node -v
npm -v2. Do not install Node.js using apt
If you see:
Command 'node' not found, but can be installed with:
sudo apt install nodejsDo not do this. Distribution packages are often outdated and may not meet GOV.UK Frontend requirements.
3. Install Node.js LTS using nvm (recommended)
Install nvm (Node Version Manager) using the instructions at:
Then install the latest Node.js LTS:
nvm install --lts
nvm use --lts
node -v
npm -vYou should now see a recent Node.js version (for example v24.x). npm is included with Node.js.
4. Install theme dependencies
Switch to the GOV.UK theme directory, for example:
cd web/themes/custom/govuk_themeIf a package-lock.json file exists, run:
npm ciOtherwise run:
npm installThis installs GOV.UK Frontend v6 and all required build dependencies.
Important: Sass compiler requirement
GOV.UK Frontend requires Dart Sass (sass) v1.79.0 or newer. LibSass (node-sass) is not supported.
npm ls sass
npm install -D sass@^1.79.0Compiling Sass (Gulp)
The theme includes Gulp locally. You do not need a global install.
npx gulpTo automatically compile Sass on changes:
npx gulp watchUpdating dependencies
npm outdatedIf packages are listed, update within the allowed version ranges:
npm updateThe v3.1.x release line is designed for GOV.UK Frontend v6. Do not downgrade GOV.UK Frontend unless specifically required.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion