Yarn error upon Ghost Update

Hi everyone,

I tried to update Ghost from 3.40.5 to the latest version (3.41.3), but I encountered an error.

I first ran sudo npm install -g ghost-cli@latest to update Ghost-CLI, then I ran ghost update while being in the Ghost folder as usual.

And I ended up with the following:

  • sudo systemctl is-active ghost_ghost-site
    :heavy_check_mark: Checking system Node.js version
    :heavy_check_mark: Ensuring user is not logged in as ghost user
    :heavy_check_mark: Checking if logged in user is directory owner
    :heavy_check_mark: Checking current folder permissions
    :heavy_check_mark: Checking folder permissions
    :heavy_check_mark: Checking file permissions
    :heavy_check_mark: Checking content folder ownership
    :heavy_check_mark: Checking memory availability
    :heavy_check_mark: Checking free space
    :heavy_check_mark: Checking for available migrations
    :heavy_check_mark: Checking for latest Ghost version
  • :bug: Fixed default urls for checkout session - Rishabh Garg

View the changelogs for full details:

:heavy_check_mark: Fetched release notes
:heavy_multiplication_x: Downloading and updating Ghost to v3.41.3
A ProcessError occurred.

Message: Command failed: yarn install --no-emoji --no-progress
Usage: yarn [options]

yarn: error: no such option: --no-emoji

Exit code: 2

Debug Information:
OS: Ubuntu, v20.04.2 LTS
Node Version: v10.19.0
Ghost Version: 3.40.5
Ghost-CLI Version: 1.15.3
Environment: production
Command: ‘ghost update’

Additional log info available in: /home/ghostuser/.ghost/logs/ghost-cli-debug-2021-02-01T20_32_23_186Z.log

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

I ran ghost doctor, but it did not help, it passes all tests.
This is the log file produced after the failure:

Debug Information:
OS: Ubuntu, v20.04.2 LTS
Node Version: v10.19.0
Ghost Version: 3.40.5
Ghost-CLI Version: 1.15.3
Environment: production
Command: ‘ghost update’
Message: Command failed: yarn install --no-emoji --no-progress
Usage: yarn [options]

yarn: error: no such option: --no-emoji

Exit code: 2

--------------- stderr ---------------
Usage: yarn [options]

yarn: error: no such option: --no-emoji

I tried allowing more RAM to the VM but not luck.
I tried to look up the error online, but what I found did not help much.

If I uninstall yarn, I then get:

Message: spawn yarn ENOENT
Exit code: ENOENT

Looking for this error code usually means not enough swap memory, but I think I have enough based on this output:

          total        used        free      shared  buff/cache   available

Mem: 1.9Gi 683Mi 537Mi 1.0Mi 765Mi 1.1Gi
Swap: 1.9Gi 0B 1.9Gi

So I am not sure what the issue is. I had no problem updating Ghost prior to this time.

error: no such option: --no-emoji

That’s the pertinent error. It’s possible you had a too-old, or too-new version of yarn installed. Can you try re-installing yarn then retry and post an update to this issue? Message: Command failed: yarn install --no-emoji --no-progress · Issue #1335 · TryGhost/Ghost-CLI · GitHub

1 Like

Thanks @Kevin.
I reinstalled yarn using sudo apt-get install yarn, and ran ghost update and ended up with the same output as before with the --no-emoji thing.

The command to install yarn, also said that it installed cmdtest instead of yarn.

I posted an update to the issue you linked.

Just to close the loop here since it continued on the github page.

I was running a very old version of yarn and for some reason, Ubuntu was not installing a new one.
@Kevin pointed me to this article where all the instructions to install a recent version of yarn is.

I uninstalled my old version and ran the 2 commands below:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

and then

sudo apt update && sudo apt install yarn

and finally, ghost update worked.
Thank you for your help :slight_smile:

2 Likes