Ghost Blog installation on FreeBSD 12

Hi @ll,

Can I ask if anyone has successfully installed Ghost Blog on FreeBSD? I’m using FreeBSD 12 STABLE.

I did clone Ghost from here: https://github.com/TryGhost/Ghost
I did run: npm install ghost-cli -g
And it went fine (well with minor hick ups really related to the Node version I had installed on the server). I was using node 13.x.x so I had to downgrade to node 12.x.x

Then I did try to run: ghost install --db=sqlite3 in an empty directory in order to install Ghost.

Unfortunately it gives me the following error message:

:heavy_check_mark: Checking system Node.js version
:heavy_check_mark: Checking current folder permissions
System checks failed with message: ‘Operating system is not Linux’
Some features of Ghost-CLI may not work without additional configuration.
For local installs we recommend using ghost install local instead.
? Continue anyway? Yes
System stack check skipped
:information_source: Checking operating system compatibility [skipped]
:heavy_check_mark: Checking memory availability
:heavy_check_mark: Checking for latest Ghost version
:heavy_check_mark: Setting up install directory
:heavy_multiplication_x: Downloading and installing Ghost v3.18.1
A ProcessError occurred.

Message: Command failed: yarn install --no-emoji --no-progress
SyntaxError: Unknown token: { line: 1, col: 0, type: ‘INVALID’, value: undefined } 1:0 in /usr/local/share/.config/yarn
at Parser.unexpected (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:64332:11)
at Parser.parse (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:64463:14)
at parse (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:64537:21)
at module.exports.exports.default (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:64099:96)
at loadRcFile (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:56942:58)
at /usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:56916:14
at /usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:101331:14
at Array.map ()
at parseRcPaths (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:101329:78)
at Object.findRc (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:101343:10)

Exit code: 1

Debug Information:
OS: FreeBSD, v12.1
Node Version: v12.16.2
Ghost-CLI Version: 1.14.0
Environment: production
Command: ‘ghost install --db=sqlite3’

Additional log info available in: /root/.ghost/logs/ghost-cli-debug-2020-06-03T10_30_20_431Z.log

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

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

Can I ask if I’m doing something wrong here? Any help would be greatly appreciated.


Best regards
macosxgeek

Hey @macosxgeek :wave:
You should be using the Ghost CLI to install Ghost and not cloning down the source from GitHub. You can see the install steps in the readme of the repo: https://github.com/TryGhost/Ghost#quickstart-install

Hi @DavidDarnes,

Thank you for your response. Basically I did clone the Ghost repo to install the Ghost CLI. Then I’ve created an empty folder in different location and I did run ‘ghost install’ in it. Do you still think cloning would be a problem here?

I believe so yes. The Ghost CLI is designed to assist you with the entire installation process, there’s no need to clone down the codebase :blush:

OK. So I have removed the cloned folder from the file system and ran:

npm install ghost-cli@latest -g

Then when I run: ghost install --db=sqlite3

I still get the same error. Following is the exception from the log file:

Blockquote
Debug Information:
OS: FreeBSD, v12.1
Node Version: v12.16.2
Ghost-CLI Version: 1.14.0
Environment: production
Command: ‘ghost install --db=sqlite3’
Message: Command failed: yarn install --no-emoji --no-progress
SyntaxError: Unknown token: { line: 1, col: 0, type: ‘INVALID’, value: undefined } 1:0 in /usr/local/share/.config/yarn
at Parser.unexpected (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:64332:11)
at Parser.parse (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:64463:14)
at parse (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:64537:21)
at module.exports.exports.default (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:64099:96)
at loadRcFile (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:56942:58)
at /usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:56916:14
at /usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:101331:14
at Array.map ()
at parseRcPaths (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:101329:78)
at Object.findRc (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:101343:10)

Exit code: 1

--------------- stderr ---------------
SyntaxError: Unknown token: { line: 1, col: 0, type: ‘INVALID’, value: undefined } 1:0 in /usr/local/share/.config/yarn
at Parser.unexpected (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:64332:11)
at Parser.parse (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:64463:14)
at parse (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:64537:21)
at module.exports.exports.default (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:64099:96)
at loadRcFile (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:56942:58)
at /usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:56916:14
at /usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:101331:14
at Array.map ()
at parseRcPaths (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:101329:78)
at Object.findRc (/usr/local/lib/node_modules/ghost-cli/node_modules/yarn/lib/cli.js:101343:10)

It might be wise to run ghost doctor to ensure everything on your server is good to go for a Ghost installation

The result of ghost doctor:

~/heavenbot/src/heaven_plugin ‹master*› $ ghost doctor
:heavy_check_mark: Checking system Node.js version
:heavy_check_mark: Checking current folder permissions
:heavy_multiplication_x: Validating config
:heavy_check_mark: Checking memory availability
:heavy_check_mark: Checking binary dependencies
One or more errors occurred.

  1. Validating config

Error detected in the production configuration.

Message: Config file is not valid JSON

Debug Information:
OS: FreeBSD, v12.1
Node Version: v12.16.2
Ghost-CLI Version: 1.14.0
Environment: production
Command: ‘ghost doctor’

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

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

Guess there’s something up with your config file :sweat_smile:. We’ve got documentation and examples to refer to here:


I have a strange feeling this won’t be an easy one… :wink:

The thing is the config file is not even created during the installation.
When I run “ghost install --db=sqlite3” and it fails with the error posted above I end up with two directories in the installation folder and nothing else:

drwxr-xr-x 8 root wheel 8B Jun 9 09:17 content
drwxr-xr-x 2 root wheel 2B Jun 9 09:17 versions

So config file is not even being created at this stage… I suspect it has something to do with Yarn installation… I was able to run this command manually: “yarn install --no-emoji --no-progress” and it works fine… But then when I try the ghost installation again it fails saying that installation directory is not empty…

@macosgeek have you managed to fix this issue ?
have exactly same problem …

I had this issue during a ghost update and solved it by looking at the logs - it seems that it was getting stuck at ~/.config/yarn (read the logs for the specific folder, for the OP it is /usr/local/share/.config/yarn for example) so I removed that whole folder (make sure to make a backup of it first), presumably it wanted to read/write the files there but there was already a preexisting directory substructure that it didn’t understand so it got stuck rather than update.

Once I removed that directory the ghost update command was able to successfully complete. And subsequently, ghost start was able to start the blog.