Steps and versions for local dev setup?

Howdy, I have spent hours today trying to get a local dev setup working from source using these docs:

Not getting anywhere and wondering if I’m using a bad Yarn version or if you can provide any other guidance?

What Node version, database, OS & browser are you using?

  • using nvm, have tried Node 16 and Node 18
  • Yarn 3.6 with both versions of Node
  • Mac OS Ventura, Intel not M1

What errors or information do you see in the console?

  • doesn’t work because Yarn 3 doesn’t have global installs. I tried to get around this with npm install -g knex-migrator and same with ember-cli. Is this reasonable workaround?
  • Supported node versions for self-hosted installs of Ghost says that “Ghost’s current recommended Node version is Node v16 LTS.” but then in the table below, says 18.x (Node v18 Hydrogen LTS) Recommended… so which is recommended?
  • back to, yarn setup never successfully runs, more info below

What steps could someone else take to reproduce the issue you’re having?

With Node 16 or 18 and Yarn 3.6:

Desktop % npm install ghost-cli@latest -g
Desktop % npm install -g ember-cli 
Desktop % npm install -g knex-migrator

then repo steps from Ghost Docs

Ghost % corepack enable # to get yarn
Ghost % yarn setup
Internal Error: ghost-monorepo@workspace:.: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile

Hmm okay, let’s do what it says:

Ghost % yarn install
➤ YN0058: │ ember-power-datepicker@ Packing the package failed (exit code 1, logs can be found here: /private/var/folders/z8/9mv15y0s3tvft80885n7jcqh0000gn/T/xfs-1ba6fa9e/pack.log)
➤ YN0000: └ Completed in 3m 55s
➤ YN0000: Failed with errors in 3m 55s

Maybe something weird with that commit/release of ember-power-datepicker… let’s delete yarn.lock and try again

Ghost % rm yarn.lock
Ghost % yarn install
➤ YN0000: Done with warnings in 19m 47s

Woohoo! Ready to try setup again:

Ghost % yarn setup
[2023-06-24 00:13:31] ERROR Cannot find module '/Desktop/Ghost/node_modules/@tryghost/post-revisions/build/index.js'. Please verify that the package.json has a valid "main" entry

Error: Cannot find module '/Desktop/Ghost/node_modules/@tryghost/post-revisions/build/index.js'. Please verify that the package.json has a valid "main" entry
    at /Desktop/Ghost/node_modules/knex-migrator/lib/index.js:240:23
    at tryPackage (node:internal/modules/cjs/loader:425:19)

Surely this is not how this process is supposed to go! Thanks in advance for any help.

for posterity, the magic combo seems to be:

  • Yarn 1.22.19 :sweat_smile:
  • at least Node 18 for yarn dev
1 Like