Update Node (Digital Ocean)

Good evening folks :wave:

I currently run my Ghost blog on a Digital Ocean droplet, and I have just tried to update to the latest version of Ghost using the command line, however I get an error.

✔ Checking system Node.js version
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking for available migrations
✔ Checking for latest Ghost version
✖ Downloading and updating Ghost to v2.33.0
A ProcessError occurred.

Message: Command failed: yarn install --no-emoji --no-progress
warning ghost@2.33.0: The engine "cli" appears to be invalid.
error csv-parser@2.3.1: The engine "node" is incompatible with this module. Expected version ">= 8.16.0". Got "8.10.0"
error Found incompatible module.

yarn install v1.16.0
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Exit code: 1


Debug Information:
    OS: Ubuntu, v18.04
    Node Version: v8.10.0
    Ghost-CLI Version: 1.11.0
    Environment: production
    Command: 'ghost update'

Additional log info available in: /home/ghost-mgr/.ghost/logs/ghost-cli-debug-2019-10-08T17_56_22_145Z.log

Try running ghost doctor to check your system for known issues.

You can always refer to https://docs.ghost.org/api/ghost-cli/ for troubleshooting. 

It looks like I need to update Node.JS? If this is the case, how do I go about this? I am a bit lost, I can find how to install it but not update. Any help would be great! Thanks.

The DigitalOcean one-click App uses nodesource.

I recommend updating to Node v10 (v8 is almost end of life)

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
ghost update --force

One you’ve updated node, you must run ghost update --force in the ghost directory, this will force Ghost to update its dependencies to match Node v10, otherwise you’ll get more errors.

4 Likes

Thanks Hannah, will give that a bash.

I truly hope that pun was intentional…

1 Like

I have to say I enjoyed it :joy:

1 Like

Hello, i’m getting the same error, but i’m NOT on digitalocean

...
warning ghost@2.33.0: The engine "cli" appears to be invalid.
error csv-parser@2.3.1: The engine "node" is incompatible with this module. Expected version ">= 8.16.0". Got "8.15.1"
error Found incompatible module.

Which is the correct procedure to update node to the recommended version and update ghost without going offline? Thanks

EDIT:
Nevermind, i found this:

Upgrade Node.js

When upgrading Node.js, you need to run the upgrade for Node and then also re-install Ghost’s dependencies. This is because Ghost has several binary dependencies which are compiled for the specific Node.js version. Without reinstalling dependencies, Ghost will fail to start with strange error messages.

To upgrade the steps are:

  1. curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - update your source list with the version of Node.js you want to upgrade to.
  2. sudo apt-get install -y nodejs - upgrade Node/ks
  3. ghost update --force - force Ghost to update even if there are no new versions of Ghost, to trigger a re-install of dependencies.

Thanks Hannah Wolfe