Help updating ghost

I am trying to update ghost 2.37.0 to anything newer. When I try to update to the latest, I can’t, because it says I need at least ghost 2.38.3. Fine. When I try to update to ghost update v2, I can’t because the node version (14.18.1) is not compatible. Fine. When I downgrade node to version 8 as it recommends, I can’t update because the cli (1.21.0) requires minimum node version of 12.

So please explain how it is even possible to update ghost with conflicting node version requirements.

System: Amazon Linux 2, Node 14.18.1 (or whatever version it wants at any given time), Ghost 2.37.0, Ghost-CLI 1.21.0.

Updating from a really old version can be frustrating, here’s a couple resources to help:

This still presents the same problem. I downgraded to ghost cli 1.9.9, but that requires node 12. Can’t update ghost to 2.38.3 unless I’m on version 8 or 10.

Any other ideas?

Ultimately this is where it stops, and can’t be resolved:

upon running ghost update 2.38.3

/usr/lib/node_modules/ghost-cli/node_modules/yargs/node_modules/yargs-parser/build/index.cjs:1013
        throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
        ^

Error: yargs parser supports a minimum Node.js version of 12. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions
    at Object.<anonymous> (/usr/lib/node_modules/ghost-cli/node_modules/yargs/node_modules/yargs-parser/build/index.cjs:1013:15)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/ghost-cli/node_modules/yargs/build/index.cjs:1:59855)
    at Module._compile (module.js:653:30)

This while trying with Node 8 and ghost-cli 1.9.9 to update from 2.37 to 2.38

@vikaspotluri123 any additional input on the above?

@vikaspotluri123 Please any assistance? The above indicates your suggestions won’t work.

Hey @petez, I’ve had a busy week, but I’m here now! :yawning_face:

Can you confirm a few things?

  1. The ghost-cli version that’s installed - since ghost -v doesn’t work…
    • cat /usr/lib/node_modules/ghost-cli/package.json | grep '"version"'
  2. What command did you run to install ghost-cli, and what was the output?
    • I ask because when trying to reproduce the issue using yarn, there was a different package I have installed that wasn’t compatible with the node version, so yarn refused to make any changes.

ghost -v says I have 1.9.9 installed, which is the last version i tried to install, with the command listed on the website:

npm install ghost-cli@latest -g

However,

cat /usr/lib/node_modules/ghost-cli/package.json | grep '"version"'

Says I have 1.21.0

It looks like you have 2 versions of the CLI installed! What happens if you run sudo npm list -g --depth=0?

I assume you don’t want the full tree output, but here is the important part:

npm WARN invalid config depth="0?"
npm WARN invalid config Must be a numeric value
/home/ec2-user/.nvm/versions/node/v14.18.1/lib

Can you try with --depth=1 instead of --depth=0?

/home/ec2-user/.nvm/versions/node/v14.18.1/lib
├── babel-cli@6.26.0
├── ghost-cli@1.9.9
├── npm@6.14.15
└── pm2@5.2.0

Hmm, what happens if you run npm list -g --depth=1 (no sudo this time)?

/home/ec2-user/.nvm/versions/node/v14.18.1/lib
├─┬ babel-cli@6.26.0
│ ├── babel-core@6.26.3
│ ├── babel-polyfill@6.26.0
│ ├── babel-register@6.26.0
│ ├── babel-runtime@6.26.0
│ ├── chokidar@1.7.0
│ ├── commander@2.20.3
│ ├── convert-source-map@1.8.0
│ ├── fs-readdir-recursive@1.1.0
│ ├── glob@7.2.0
│ ├── lodash@4.17.21
│ ├── output-file-sync@1.1.2
│ ├── path-is-absolute@1.0.1
│ ├── slash@1.0.0
│ ├── source-map@0.5.7
│ └── v8flags@2.1.1
├─┬ ghost-cli@1.9.9
│ ├── abbrev@1.1.1
│ ├── adm-zip@0.4.13
│ ├── bluebird@3.5.3
│ ├── chalk@2.4.1
│ ├── cli-table3@0.5.0
│ ├── debug@4.1.0
│ ├── decompress@4.2.0
│ ├── download@7.1.0
│ ├── execa@1.0.0
│ ├── find-plugins@1.1.7
│ ├── fkill@5.3.0
│ ├── fs-extra@7.0.1
│ ├── generate-password@1.4.1
│ ├── global-modules@2.0.0
│ ├── got@8.3.2
│ ├── inquirer@6.2.1
│ ├── is-running@2.1.0
│ ├── latest-version@4.0.0
│ ├── listr@0.14.3
│ ├── lodash@4.17.11
│ ├── log-symbols@2.2.0
│ ├── moment@2.23.0
│ ├── mysql@2.16.0
│ ├── ora@3.0.0
│ ├── path-is-root@0.1.0
│ ├── portfinder@1.0.20
│ ├── prettyjson@1.2.1
│ ├── read-last-lines@1.6.0
│ ├── replace-in-file@3.4.2
│ ├── rxjs@5.5.11
│ ├── semver@5.6.0
│ ├── shasum@1.0.2
│ ├── stat-mode@0.2.2
│ ├── strip-ansi@5.0.0
│ ├── symlink-or-copy@1.2.0
│ ├── systeminformation@3.52.0
│ ├── tail@2.0.2
│ ├── validator@7.2.0
│ ├── yargs@12.0.5
│ └── yarn@1.12.3
├─┬ npm@6.14.15
│ ├── abbrev@1.1.1
│ ├── ansicolors@0.3.2
│ ├── ansistyles@0.1.3
│ ├── aproba@2.0.0
│ ├── archy@1.0.0
│ ├── bin-links@1.1.8
│ ├── bluebird@3.5.5
│ ├── byte-size@5.0.1
│ ├── cacache@12.0.3
│ ├── call-limit@1.1.1
│ ├── chownr@1.1.4
│ ├── ci-info@2.0.0
│ ├── cli-columns@3.1.2
│ ├── cli-table3@0.5.1
│ ├── cmd-shim@3.0.3
│ ├── columnify@1.5.4
│ ├── config-chain@1.1.12
│ ├── debuglog@1.0.1
│ ├── detect-indent@5.0.0
│ ├── detect-newline@2.1.0
│ ├── dezalgo@1.0.3
│ ├── editor@1.0.0
│ ├── figgy-pudding@3.5.1
│ ├── find-npm-prefix@1.0.2
│ ├── fs-vacuum@1.2.10
│ ├── fs-write-stream-atomic@1.0.10
│ ├── gentle-fs@2.3.1
│ ├── glob@7.1.6
│ ├── graceful-fs@4.2.4
│ ├── has-unicode@2.0.1
│ ├── hosted-git-info@2.8.9
│ ├── iferr@1.0.2
│ ├── imurmurhash@0.1.4
│ ├── infer-owner@1.0.4
│ ├── inflight@1.0.6
│ ├── inherits@2.0.4
│ ├── ini@1.3.8
│ ├── init-package-json@1.10.3
│ ├── is-cidr@3.0.0
│ ├── json-parse-better-errors@1.0.2
│ ├── JSONStream@1.3.5
│ ├── lazy-property@1.0.0
│ ├── libcipm@4.0.8
│ ├── libnpm@3.0.1
│ ├── libnpmaccess@3.0.2
│ ├── libnpmhook@5.0.3
│ ├── libnpmorg@1.0.1
│ ├── libnpmsearch@2.0.2
│ ├── libnpmteam@1.0.2
│ ├── libnpx@10.2.4
│ ├── lock-verify@2.1.0
│ ├── lockfile@1.0.4
│ ├── lodash._baseindexof@3.1.0
│ ├── lodash._baseuniq@4.6.0
│ ├── lodash._bindcallback@3.0.1
│ ├── lodash._cacheindexof@3.0.2
│ ├── lodash._createcache@3.1.2
│ ├── lodash._getnative@3.9.1
│ ├── lodash.clonedeep@4.5.0
│ ├── lodash.restparam@3.6.1
│ ├── lodash.union@4.6.0
│ ├── lodash.uniq@4.5.0
│ ├── lodash.without@4.4.0
│ ├── lru-cache@5.1.1
│ ├── meant@1.0.2
│ ├── mississippi@3.0.0
│ ├── mkdirp@0.5.5
│ ├── move-concurrently@1.0.1
│ ├── node-gyp@5.1.0
│ ├── nopt@4.0.3
│ ├── normalize-package-data@2.5.0
│ ├── npm-audit-report@1.3.3
│ ├── npm-cache-filename@1.0.2
│ ├── npm-install-checks@3.0.2
│ ├── npm-lifecycle@3.1.5
│ ├── npm-package-arg@6.1.1
│ ├── npm-packlist@1.4.8
│ ├── npm-pick-manifest@3.0.2
│ ├── npm-profile@4.0.4
│ ├── npm-registry-fetch@4.0.7
│ ├── npm-user-validate@1.0.1
│ ├── npmlog@4.1.2
│ ├── once@1.4.0
│ ├── opener@1.5.2
│ ├── osenv@0.1.5
│ ├── pacote@9.5.12
│ ├── path-is-inside@1.0.2
│ ├── promise-inflight@1.0.1
│ ├── qrcode-terminal@0.12.0
│ ├── query-string@6.8.2
│ ├── qw@1.0.1
│ ├── read@1.0.7
│ ├── read-cmd-shim@1.0.5
│ ├── read-installed@4.0.3
│ ├── read-package-json@2.1.1
│ ├── read-package-tree@5.3.1
│ ├── readable-stream@3.6.0
│ ├── readdir-scoped-modules@1.1.0
│ ├── request@2.88.0
│ ├── retry@0.12.0
│ ├── rimraf@2.7.1
│ ├── safe-buffer@5.1.2
│ ├── semver@5.7.1
│ ├── sha@3.0.0
│ ├── slide@1.1.6
│ ├── sorted-object@2.0.1
│ ├── sorted-union-stream@2.1.3
│ ├── ssri@6.0.2
│ ├── stringify-package@1.0.1
│ ├── tar@4.4.19
│ ├── text-table@0.2.0
│ ├── tiny-relative-date@1.3.0
│ ├── uid-number@0.0.6
│ ├── umask@1.1.0
│ ├── unique-filename@1.1.1
│ ├── unpipe@1.0.0
│ ├── update-notifier@2.5.0
│ ├── uuid@3.3.3
│ ├── validate-npm-package-license@3.0.4
│ ├── validate-npm-package-name@3.0.0
│ ├── which@1.3.1
│ ├── worker-farm@1.7.0
│ └── write-file-atomic@2.4.3
└─┬ pm2@5.2.0
  ├── @pm2/agent@2.0.1
  ├── @pm2/io@5.0.0
  ├── @pm2/js-api@0.6.7
  ├── @pm2/pm2-version-check@1.0.4
  ├── async@3.2.3
  ├── blessed@0.1.81
  ├── chalk@3.0.0
  ├── chokidar@3.5.3
  ├── cli-tableau@2.0.1
  ├── commander@2.15.1
  ├── croner@4.1.97
  ├── dayjs@1.8.36
  ├── debug@4.3.4
  ├── enquirer@2.3.6
  ├── eventemitter2@5.0.1
  ├── fclone@1.0.11
  ├── mkdirp@1.0.4
  ├── needle@2.4.0
  ├── pidusage@3.0.0
  ├── pm2-axon@4.0.1
  ├── pm2-axon-rpc@0.7.1
  ├── pm2-deploy@1.0.2
  ├── pm2-multimeter@0.1.2
  ├── pm2-sysmonit@1.2.8
  ├── promptly@2.2.0
  ├── semver@7.3.5
  ├── source-map-support@0.5.19
  ├── sprintf-js@1.1.2
  ├── vizion@2.2.1
  └── yamljs@0.3.0

Ok it looks like npm is configured properly… what’s the output of which ghost?

~/.nvm/versions/node/v14.18.1/bin/ghost

And ~/.nvm/versions/node/v14.18.1/bin/ghost -v Fails, right?

No, it returns:

Ghost-CLI version: 1.9.9

In that case, can you use that command to manage ghost? You should be able to make the upgrade

Ok, that worked to get updated to 2.38.3. I want to keep going to get up to the latest version, but need to know how to step up. The node compatibility matrix for ghost is insanely frustrating.