Definitive guide to updating Sage / Bud

Is there a resource available which shows how to reliably upgrade to the latest version of Sage 10 from an earlier version of Sage 10?

I tried just updating my package.json to use @roots/sage 6.6.10 (and matching versions of @roots/bud-tailwindcss and @roots/bud) and running npm update but everything broke in a fairly glorious manner - it would no longer build (trace below). A fresh install of Sage / Bud works just fine, so it’s something in my current project but I’m at a complete loss to know what it is or how to diagnose it.

TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file
    at new NodeError (node:internal/errors:371:5)
    at fileURLToPath (node:internal/url:1419:11)
    at Array.map (<anonymous>)
    at file:///Users/stevejones/Sites/client/twofour/web/app/themes/twofour23/node_modules/@roots/bud/lib/cli/finder.js:74:50
    at async Commands.resolveExtensionCommandPaths (file:///Users/stevejones/Sites/client/twofour/web/app/themes/twofour23/node_modules/@roots/bud/lib/cli/finder.js:69:16)
    at async Commands.getRegistrationModulePaths (file:///Users/stevejones/Sites/client/twofour/web/app/themes/twofour23/node_modules/@roots/bud/lib/cli/finder.js:45:16)
    at async Commands.getCommands (file:///Users/stevejones/Sites/client/twofour/web/app/themes/twofour23/node_modules/@roots/bud/lib/cli/finder.js:37:40)
    at async file:///Users/stevejones/Sites/client/twofour/web/app/themes/twofour23/node_modules/@roots/bud/lib/cli/app.js:34:1 {
  code: 'ERR_INVALID_URL_SCHEME'
}

Every Bud release that introduces breaking changes comes with an upgrade guide in the release notes. There’s also diffs from the Sage repo itself that you can reference.

It’s important for us to know what version of Bud you’re attempting to upgrade from for more specific guidance — “from an earlier version” isn’t enough for us to work with.

1 Like

Hi @ben - sorry for the lack of detail. I was attempting to upgrade from Bud / Sage 6.3.4 to 6.6.10

Can you try doing a npm install --force after changing the versions in your package.json file instead of doing npm update?

I duplicated the working theme running 6.3.4 and switched to it.
Then changed the versions in package.json to 6.6.10 and ran npm install --force
Installation seemed to go well - completed without error and 0 vulnerabilities
Ran yarn dev and immediately got the same error trace as before:

TypeError [ERR_INVALID_URL_SCHEME]: The URL must be of scheme file
    at new NodeError (node:internal/errors:371:5)
    at fileURLToPath (node:internal/url:1419:11)
    at Array.map (<anonymous>)
    at file:///Users/stevejones/Sites/client/twofour/web/app/themes/twofour24/node_modules/@roots/bud/lib/cli/finder.js:74:50
    at async Commands.resolveExtensionCommandPaths (file:///Users/stevejones/Sites/client/twofour/web/app/themes/twofour24/node_modules/@roots/bud/lib/cli/finder.js:69:16)
    at async Commands.getRegistrationModulePaths (file:///Users/stevejones/Sites/client/twofour/web/app/themes/twofour24/node_modules/@roots/bud/lib/cli/finder.js:45:16)
    at async Commands.getCommands (file:///Users/stevejones/Sites/client/twofour/web/app/themes/twofour24/node_modules/@roots/bud/lib/cli/finder.js:37:40)
    at async file:///Users/stevejones/Sites/client/twofour/web/app/themes/twofour24/node_modules/@roots/bud/lib/cli/app.js:34:1 {
  code: 'ERR_INVALID_URL_SCHEME'
}
error Command failed with exit code 7.

Any idea what could be causing that?