2

I have a CentOS 7 machine with mysql server and nginx. I installed nodejs with yum install nodejs and ghost-cli.

I wanted to install ghost with ghost-cli. but when I enter the ghost install commant I get this error:

✖ Checking system Node.js version
A SystemError occurred.

Message: The version of Ghost-CLI you are running was not installed with this version of Node.
This means there are likely two versions of Node running on your system, please ensure
that you are only running one global version of Node before continuing.

Debug Information:
    Node Version: v6.11.1
    Ghost-CLI Version: 1.1.0
    Environment: production
    Command: 'ghost install'

What's caused this error and how can I fix that? Thank you.

Ahmad
  • 129
  • 12
  • do you have multiple version of node installed? – leninhasda Aug 15 '17 at 18:18
  • no. just one version – Ahmad Aug 15 '17 at 18:25
  • I started facing the same issue just 10 minutes ago on a trusty64 machine. In my case, it's happening only when I install using Ansible playbook. I have installed node v6.11.2 via nvm and can see that ghost is installed using same node version (inside `.nvm/versions/node/v6.11.2/bin`) along with npm and node (all 3 are symlinked to `/usr/local/bin`) and running `which node` (or npm or ghost) shows correct path – mohitsharma44 Aug 15 '17 at 18:31
  • @mohitsharma44 so please vote up this question to get an answer – Ahmad Aug 15 '17 at 18:34
  • @Ahmad yep, just did... Also, I should mention that the same playbook was working fine until 2 days ago. – mohitsharma44 Aug 15 '17 at 18:40
  • I've just run the command with root user and surprisingly it works – Ahmad Aug 15 '17 at 18:50
  • 1
    @Ahmad, I just tested.. in case you don't want to run things as a root user, you can install ghost-cli@1.0.3 and proceed with the installation. – mohitsharma44 Aug 15 '17 at 20:22
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/151996/discussion-between-mohitsharma44-and-ahmad). – mohitsharma44 Aug 16 '17 at 01:48

1 Answers1

1

[Edited after Austin, the core contributor of Ghost-CLI, responded to the issue]

I asked Austin, why he chose to not use local npm version?

He responded:

The reason for that is ghost creates a specific ghost user with which to run ghost. If you install nvm locally (e.g. in ~/.nvm), there is a very real (e.g. has happened several times) possibility that the created ghost user won't be able to run ghost because the home folder doesn't allow read permissions for everyone on the filesystem.

Going to close this issue for now - if more people have issues with this then we can reopen and figure out a better solution


Ok, so looks like you were able to resolve by running the installation as root but this is not something that I can do so I dug a little deeper into code that was pushed in the last couple of days to Ghost-CLI and my best guess is that this specific commit fix nvm -- ea30015 is causing the permission issue.

I have created an issue #447 with Ghost-CLI project to see if they can confirm it as well.

mohitsharma44
  • 316
  • 2
  • 11
  • in my case the problem wasn't the nvm. Though I actually decided to change the machine to ubuntu 16.0.4 LTS and on that machine it works for me. – Ahmad Aug 16 '17 at 19:38