Clarification required - is sage 10 or 9 installed using docs instructions?

I ran this installer in the docs assuming that this would be sage 10 as I thought that was now the minimum recommended version.

# From your WordPress themes directory, run:
$ composer create-project roots/sage your-theme-name

But when I look into the details on the install I can see actually it says sage 9 "version": "9.0.10",in package.json. Confused as it needed Acorn etc which was my understanding was brought in for v10? So now not sure if just the version no is wrong but the install is v10.

And if not what are the steps for installing v10? :melting_face:

Is this what I need to do?

To install the latest development version of Sage, add dev-main to the end of the command:

$ composer create-project roots/sage your-theme-name dev-main

Here’s the package.json from a fresh install using composer create-project roots/sage. This is what it should look like for sage v10.4.0:

{
  "name": "sage",
  "private": true,
  "browserslist": [
    "extends @roots/browserslist-config"
  ],
  "engines": {
    "node": ">=16.0.0"
  },
  "type": "module",
  "scripts": {
    "dev": "bud dev",
    "build": "bud build",
    "translate": "yarn translate:pot && yarn translate:update",
    "translate:pot": "wp i18n make-pot . ./resources/lang/sage.pot --include=\"app,resources\"",
    "translate:update": "for filename in ./resources/lang/*.po; do msgmerge -U $filename ./resources/lang/sage.pot; done; rm -f ./resources/lang/*.po~",
    "translate:compile": "yarn translate:mo && yarn translate:js",
    "translate:js": "wp i18n make-json ./resources/lang --pretty-print",
    "translate:mo": "wp i18n make-mo ./resources/lang ./resources/lang"
  },
  "devDependencies": {
    "@roots/bud": "6.6.9",
    "@roots/bud-tailwindcss": "6.6.9",
    "@roots/sage": "6.6.9"
  }
}

2 Likes

If running composer create-project roots/sage doesn’t result in a Sage v10 theme then it’s likely that your machine doesn’t meet the PHP requirements to install it

You could try passing the --ignore-platform-reqs flag to get around it

Thank you @Ben!

Local WP was running php8, which was confirmed via the WordPress interface, but when I went to the folder via terminal it was then reporting version 7. I have now updated on the actual filesystem and reinstalled everything. Had no idea these could be separate. Every day is a school day!

3 Likes