Install Node.js 22+
We recommend nvm to manage Node versions.nvm install 22
nvm use 22
Install Yarn
Pastures uses Yarn Classic (1.x). Clone the repository
git clone https://github.com/IQCG/pastures-rancher.git
cd pastures-rancher
Install dependencies
yarn install --ignore-engines
The --ignore-engines flag is required because @rancher/shell may declare strict Node engine constraints that conflict with newer Node versions. The extension works correctly on Node 22+.
Build the extension
This compiles the extension into dist-pkg/. Start the package server
The dev server starts at http://127.0.0.1:4500 and serves the built extension artifacts. If you rebuild the extension, the server picks up the new files automatically. Start or connect to Rancher
Option A — Docker (quick start):docker run -d --restart=unless-stopped \
-p 80:80 -p 443:443 \
--privileged \
rancher/rancher:latest
Option B — Existing instance:
Point your browser at your Rancher dashboard URL. Developer Load the extension
- Open the Rancher UI and navigate to Extensions.
- Click the ⋮ menu (top-right) and select Developer Load.
- Enter
http://127.0.0.1:4500 as the extension URL.
- The Pastures extension appears in the sidebar after a page refresh.
Enable demo mode
If you don’t have a Pastures Engine instance, enable Demo Mode in Pastures → Settings to work with synthetic data. This lets you develop and test UI changes without a backend.
Common Issues
If yarn serve-pkgs fails with a port conflict, ensure no other process is using port 4500. You can check with lsof -i :4500.
| Problem | Solution |
|---|
ERR! engine during install | Add --ignore-engines to the install command |
| Extension not visible in Rancher | Refresh the page; confirm serve-pkgs is running and accessible |
| API calls failing | Enable demo mode in Settings or configure a valid Engine URL |