Unable to upgrade

Keywords: Ghost - AWS - Technical issue - Upgrade
bnsupport ID: 63cbe730-e2d3-fd1d-07e6-e773abb0bba6
Hello, I’m following the instructions here (https://docs.bitnami.com/installer/apps/ghost/administration/upgrade/)
to update, but am getting this error…

ghost update
  throw err;

[Error: Cannot find module '../config'
Require stack:
- /opt/bitnami/apps/ghost/lib/node_modules/ghost-cli/bin/ghost
  at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
  at Function.Module._load (internal/modules/cjs/loader.js:725:27)
  at Module.require (internal/modules/cjs/loader.js:952:19)
  at require (internal/modules/cjs/helpers.js:88:18)
  at Object.<anonymous> (/opt/bitnami/apps/ghost/lib/node_modules/ghost-cli/bin/ghost:5:12)
  at Module._compile (internal/modules/cjs/loader.js:1063:30)
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
  at Module.load (internal/modules/cjs/loader.js:928:32)
  at Function.Module._load (internal/modules/cjs/loader.js:769:14)
  at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
  at internal/main/run_main_module.js:17:47
] {
  requireStack: [ '/opt/bitnami/apps/ghost/lib/node_modules/ghost-cli/bin/ghost' ]

Please advise

Hi @invoker

Thanks for using Bitnami Ghost!

From the error log, it seems that the ghost-cli binary is either missing or not updated. Have you followed these steps before executing the ghost update command?


Could you please execute the following command?

$ ls -la /opt/bitnami/apps/ghost/lib/node_modules/ghost-cli/bin/ghost

I have followed the guide and tried to upgrade the stack from the version you are running and did not face any issues:

$ cd /opt/bitnami/apps/ghost/lib
$ sudo mv package.json package.json.back
$ sudo npm install ghost-cli
npm WARN saveError ENOENT: no such file or directory, open '/opt/bitnami/apps/ghost/lib/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/opt/bitnami/apps/ghost/lib/package.json'
npm WARN lib No description
npm WARN lib No repository field.
npm WARN lib No README data
npm WARN lib No license field.

+ ghost-cli@1.17.3
added 35 packages from 18 contributors, updated 1 package and audited 663 packages in 5.787s

34 packages are looking for funding
  run `npm fund` for details

found 6 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

$ sudo mv package.json.back package.json
$ cd /opt/bitnami/apps/ghost/htdocs/
$ ghost update
✔ Checking system Node.js version - found v14.16.1
ℹ Ensuring user is not logged in as ghost user [skipped]
ℹ Checking if logged in user is directory owner [skipped]
✔ Checking current folder permissions
✔ Checking memory availability
✔ Checking free space
✔ Checking for available migrations
✔ Checking for latest Ghost version

# 4.8.3

* 🐛 Fixed incorrect data returned when using API fields - Daniel Lockyer


View the changelogs for full details:
* Ghost - https://github.com/tryghost/ghost/compare/v4.8.2...v4.8.3
* Ghost-Admin - https://github.com/tryghost/admin/compare/v4.8.2...v4.8.3

✔ Fetched release notes
✔ Downloading and updating Ghost to v4.8.3
✔ Stopping Ghost
✔ Linking latest Ghost and recording versions
✔ Restarting Ghost
ℹ Removing old Ghost versions [skipped]

$ cd /opt/bitnami/apps/ghost
$ sudo chown bitnami:daemon -R ./htdocs ./conf/ ./bin/
$ sudo find ./htdocs -type f -exec chmod 664 {} \;
$ sudo find ./htdocs -type d -exec chmod 775 {} \;
$ sudo chmod 640 ./htdocs/config.production.json

Best regards,
Jose Antonio Carmona

Was my answer helpful? Click on :heart:

That was it. So strange, I did an install, but it didn’t work. thank you!

Glad to see you were able to solve your issue! We are marking the previous answer as “Solution” and this topic as “Closed”.

If you have any other questions, please do not hesitate to let us know. Feel free to create a new topic referencing this one if necessary.

Best regards,
Jose Antonio Carmona

Was my answer helpful? Click on :heart: