2 min read

Upgrade to Ghost 2.0

Tried to upgrade Ghost,  since Ghost 2.0 was released , first I need to upgrade to the latest Ghost 1.0 version.

$ ghost update
Running sudo command: systemctl is-active ghost_muyexi-im
✔ 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
A CliError occurred.

Message: You are about to migrate to Ghost 2.0. Your blog is not on the latest Ghost 1.0 version.
Help: Please run "ghost update --v1".

Debug Information:
    OS: Ubuntu, v16.04
    Node Version: v8.11.4
    Ghost-CLI Version: 1.9.1
    Environment: production
    Command: 'ghost update'

Additional log info available in: /home/muyexi/.ghost/logs/ghost-cli-debug-2018-08-21T13_38_40_625Z.log

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

Please refer to https://docs.ghost.org/v1/docs/troubleshooting#section-cli-errors for troubleshooting.

Then I came across a error:

$ ghost update --v1
Running sudo command: systemctl is-active ghost_muyexi-im
✔ 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 v1.25.5
A ProcessError occurred.

Message: Command failed: yarn install --no-emoji --no-progress
warning [email protected]: The engine "cli" appears to be invalid.
error An unexpected error occurred: "/home/muyexi/.cache/yarn/v2/npm-babel-types-6.26.0-a3b073f94ab49eb6fa55cd65227a334380632497/.yarn-metadata.json: Unexpected end of JSON input".

yarn install v1.9.4
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info If you think this is a bug, please open a bug report with the information provided in "/var/www/ghost/versions/1.25.5/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Exit code: 1

Debug Information:
    OS: Ubuntu, v16.04
    Node Version: v8.11.4
    Ghost-CLI Version: 1.9.1
    Environment: production
    Command: 'ghost update --v1'

Additional log info available in: /home/muyexi/.ghost/logs/ghost-cli-debug-2018-08-21T13_39_01_804Z.log

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

Please refer to https://docs.ghost.org/v1/docs/troubleshooting#section-cli-errors for troubleshooting.

It persists even though I upgraded my node to v8. Confused. Nobody has the same problem like mine after searching through the issue list.

After I found .yarn-metadata.json was empty, I removed the file and tried again. Everything started to working like usual. 🎉!